newuser
2012-12-03T11:35:54Z
I have a 10 data igrid view for which I will like data grid to remember column widths and column relative positions after a user has changed them.

Is there any property which I can save in a variable and later use that variable to re enforce the same column width and order.

for eg. i want something like this --

thedatagridview.afterusermodifiedcolumns += new EventHandler(thedatagridview_afterusermodifiedcolumns);

void thedatagridview_afterusermodifiedcolumns()
{
columnProperties = thedatagridview.colLayout;
}

void filldata()
{
thedatagridview.fillwithdata(datatable);
thedatagridview.colLayout = columnProperties ;
}
Igor/10Tec
2012-12-03T12:41:51Z
The iGrid.LayoutObject.Text is designated for that. Read it (string) to get the current column layout, and then assign the saved string back on app launch.

The LayoutObject.Flags property specifies what layout items are stored. By default these are column width, order number and visibility.