We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

BaseStyleMap

During development I keep loosing BaseStyleMap settings in the compiled exe. I mean it is in the design view, but disappearing from the code and the product. If I go and do any change in the BaseStyleMap it reappears. It is rather annoying.

9 Replies

AD Administrator Syncfusion Team March 9, 2003 08:19 AM UTC

Can you post a sample project showing the problem? Or, create a DirectTrac support incident, and post a sample there?


PK Pal Koncsik March 9, 2003 09:28 AM UTC

For example if I change the autoresizefit setting, the basestylesmap gone inmediatly.


AD Administrator Syncfusion Team March 9, 2003 10:26 AM UTC

This appears to be a bug. We'll have to get it fixed. In the meantime, probably the simplest thing to do to avoid the hassle losing your basestyles is to copy the generated code into a new method and call that method from a FormLoad handler. This means the code will be hit even if it gets zapped from the generated code. Of course this makes using the designer for basestyles not optimal. But if your basestyles are more or less static, then this work around may be usualble until we can fix this is a release. To give you an idea of what I mean, I just changed the BackColor of the Header basestyle. From the designer generated code, I copied these two code blocks into a separate method that I called from the FormLoad to guarantee my modified basestyles were used.
//first code block
Syncfusion.Windows.Forms.Grid.GridBaseStyle gridBaseStyle1 = new Syncfusion.Windows.Forms.Grid.GridBaseStyle();
Syncfusion.Windows.Forms.Grid.GridBaseStyle gridBaseStyle2 = new Syncfusion.Windows.Forms.Grid.GridBaseStyle();
Syncfusion.Windows.Forms.Grid.GridBaseStyle gridBaseStyle3 = new Syncfusion.Windows.Forms.Grid.GridBaseStyle();
Syncfusion.Windows.Forms.Grid.GridBaseStyle gridBaseStyle4 = new Syncfusion.Windows.Forms.Grid.GridBaseStyle();


//second code block
gridBaseStyle1.Name = "Header";
gridBaseStyle1.StyleInfo.Borders.Bottom = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.None);
gridBaseStyle1.StyleInfo.Borders.Left = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.None);
gridBaseStyle1.StyleInfo.Borders.Right = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.None);
gridBaseStyle1.StyleInfo.Borders.Top = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.None);
gridBaseStyle1.StyleInfo.CellType = "Header";
gridBaseStyle1.StyleInfo.Font.Bold = true;
gridBaseStyle1.StyleInfo.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(192)), ((System.Byte)(192))));
gridBaseStyle1.StyleInfo.VerticalAlignment = Syncfusion.Windows.Forms.Grid.GridVerticalAlignment.Middle;
gridBaseStyle2.Name = "Column Header";
gridBaseStyle2.StyleInfo.BaseStyle = "Header";
gridBaseStyle2.StyleInfo.CellType = "ColumnHeaderCell";
gridBaseStyle2.StyleInfo.Enabled = false;
gridBaseStyle2.StyleInfo.Font.Bold = false;
gridBaseStyle2.StyleInfo.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Center;
gridBaseStyle3.Name = "Row Header";
gridBaseStyle3.StyleInfo.BaseStyle = "Header";
gridBaseStyle3.StyleInfo.CellType = "RowHeaderCell";
gridBaseStyle3.StyleInfo.Enabled = true;
gridBaseStyle3.StyleInfo.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Left;
gridBaseStyle4.Name = "Standard";
gridBaseStyle4.StyleInfo.CheckBoxOptions.CheckedValue = "True";
gridBaseStyle4.StyleInfo.CheckBoxOptions.UncheckedValue = "False";
gridBaseStyle4.StyleInfo.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.SystemColors.Window);
this.gridDataBoundGrid1.BaseStylesMap.AddRange(new Syncfusion.Windows.Forms.Grid.GridBaseStyle[] {  gridBaseStyle1,
	 gridBaseStyle2,
	 gridBaseStyle3,
	 gridBaseStyle4});			


PK Pal Koncsik March 9, 2003 05:55 PM UTC

HELP!! I deleted a line in the generated code (pretty valid), changed to design code, and Visual Studio closed down in a millisecond. Now i can't open the project, because it is inmediatly closing down. It is just this product with this grid, and i rebooted my computer and everything. see the attached project. I just bought this damn thing...


AD Administrator Syncfusion Team March 9, 2003 07:58 PM UTC

Here is your project back slightly modified. I was able to load it. And when I tried to open the form in the designer, Dev Stu shut down like you described. I then moved the basestyles from the generated code to a a separate method and was able to open the form in the designer. There was also a missing Row_Leave (or Row_XXXX) that I removed that you will have to add back if you want it. After doing this I was able to open and close the project and use the designer, and compile it. I could not run it because of the data dependencies.


PA pal March 10, 2003 05:31 AM UTC

As you can see from Direct-Trac I was able to identify the line of codes causing the crash, but altogather it took me an hour and one of the reason for me to purchase this grid to save time and not to waste it. While being positive due to the support I receive which so far much better than anything else I experienced, I hope the designer issues will be ironed out quickly because I use it extensively.


AD Administrator Syncfusion Team March 10, 2003 08:27 AM UTC

The problem of setting double properties larger than 1E100 with the designer is a problem with the .NET Framework. Attached is a project without any Syncfusion code that has the same behavior. Manully changing the value of the double in the desinger generated code to some lesser value (say 1e10) will allow the project to run properly. As of version 1.5.1.1, we thought we had avoided this problem just by not writing out double.MaxValue and double.MinValue in the designer, just taking the defaults. If you have a project that was created with an earlier version, then you should manually remove these lines, and the newer versions will not try to write them out (hence avoiding the problem). If the latest version (1.5.2.0) is actually still writing out these large values in the designer generated code, then we would like to know about it so we can see why.


PA pal March 10, 2003 12:09 PM UTC

Fortunatly the project was created in 1.5.0.0, so hopefully it won't happen again. But please inform me when you corrected the basestylesmap bug.


PC Pascal Couture March 13, 2003 10:42 AM UTC

When I was working yesterday afternoon on one of my forms that contains a grid, I started having the same problem. My base styles kept disapearing and it started out of nowhere. After reading the different post backs, I found that for some reason your code generator put the dim gridbasestyle 1 through 4 in the code. But after commenting it out, I wrote this in my form load. MsgBox(grdSchedule.BaseStylesMap.Count) And it gave me 4 styles, so I guess that for some reason it regenerates the 4 base styles so thats probably what's causing the problem with the grid. Hope this helps... What I did to solve my problem is block every base style code and put in this in my form load : 'Patch for grid until problem is fixed With grdSchedule.BaseStylesMap.Item("Header") .StyleInfo.Font.Bold = True .StyleInfo.Font.Size = 7.0! .StyleInfo.VerticalAlignment = Syncfusion.Windows.Forms.Grid.GridVerticalAlignment.Middle End With With grdSchedule.BaseStylesMap.Item("Column Header") .StyleInfo.BaseStyle = "Header" .StyleInfo.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Center End With With grdSchedule.BaseStylesMap.Item("Row Header") .StyleInfo.BaseStyle = "Header" .StyleInfo.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Left End With With grdSchedule.BaseStylesMap.Item("Standard") .StyleInfo.Font.Facename = "Tahoma" .StyleInfo.Font.Size = 7.0! End With By the way, I'm using 1.5.1.6. Have a nice day

Loader.
Up arrow icon