The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
While our app being closed, we are saving the grid xml settings and then applying them when app is run again. Below are the code snippets.
//Get Grid Settings xml
StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); XmlTextWriter xw = new XmlTextWriter(sw); grd.WriteXmlSchema(xw); xw.Close(); sw.Close(); xml = sb.ToString();
//Apply saved settings on Grid StringReader sr = new StringReader(settings); XmlReader xr = new XmlTextReader(sr); GridEngine tempEngine = GridEngine.CreateFromXml(xr); //load grid settings into temp engine(doesnt make any diff to current problem) xr.Close();
GGC.Engine.TableDescriptor.Columns.Clear(); //prevent errors like {"Item has already been added. Key in dictionary: '' Key being added: 'COLUMN NAME'"}. GGC.Engine.InitializeFrom(engine);
Now our problem is, when we add or remove any column in runtime, settings are saved and re-applied correctly. But when we just resize any column (say "ColumnName") to say 19, we see the column width correctly saved in xml file. Even after the line "GGC.Engine.InitializeFrom(engine);", we can see column width correctly.
I mean, GGC.TableDescriptor.Columns.FindByMappingName("ColumnName").Width will give correct value. But, the grid display is not changed, column is not resized and in display the column width appears as if 150(default width). This is strange. Even when we debug now, the value of GGC.TableDescriptor.Columns.FindByMappingName("ColumnName").Width will be 19 only!
When we test further we found that, when we manually resize the column in run time and check for "GGC.TableDescriptor.Columns.FindByMappingName("ColumnName").Width" it gives incorrect values.
So, we think, though columns widths are changed using GridColumnDescriptor, they are not resized/grid is not properly refreshed. And manual resize is not updating "GGC.TableDescriptor.Columns.FindByMappingName("ColumnName").Width" values. End of the day we are not able to see width changes.
ADAdministrator Syncfusion Team March 1, 2007 09:11 PM UTC
Hi Rajani,
Thanks for your update.
I am not sure of what be might be causing this strange behavior without a working sample. I have tested this issue in the XML Serialization browser sample with Essentail studio V.4.x. I was not able to reproduce the issue. Is it possible for you to upload us a minimal sample or modify the XML Serialization browser sample to reproduce the issue here? This will help us to analyse the issue further.
Here is a path. C:\Program Files\Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Grouping.Windows\Samples\Serialization\XML Serialization\cs