Home › Forums › WinForms controls › Xceed Grid for WinForms › Saving layout of grid › Reply To: Saving layout of grid
Well, I also need this function on the grid.
As now I use this method to retrive these settings:
public string _getAllColumnSettings()
{
System.Text.StringBuilder res = new System.Text.StringBuilder();
try
{
//************
foreach (Xceed.Grid.Column col in this.gridControl1.Columns)
{
res.Append(col.FieldName + “*” + col.Visible + “*”);
}
//************
res.Append(“#”);
foreach (Xceed.Grid.Column col in this.gridControl1.Columns)
{
res.Append(col.FieldName + “*” + col.Width + “*”);
}
//***************
res.Append(“#”);
foreach (Xceed.Grid.Column col in this.gridControl1.Columns)
{
res.Append(col.FieldName + “*” + col.SortDirection + “*”);
}
//***************
res.Append(“#”);
foreach (Xceed.Grid.Column col in this.gridControl1.Columns)
{
res.Append(col.FieldName + “*” + col.VisibleIndex + “*”);
}
}
catch (Exception ex)
{
throw new Exception(ex.StackTrace);
}
return str;
}
This method returns one very very long string, that represent the grid’s layout
Imported from legacy forums. Posted by C# (had 340 views)