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

Moving Columns

if usrs are allowed to move columns, by having the AllowDragSelectedCols = true;, and you are trying to repopulate the grid in real time, the populatevalues call does not automatically take into account the moved columns. Do i have to implement my own store of which column has moved from position a to b, and then i will not be able to call populatevalues on a row, but will have to do it on individual cells. Trevor

3 Replies

AD Administrator Syncfusion Team September 24, 2003 01:57 PM

If you need to keep track of the original position that a column had before the user moved around columns a little trick is to assign the column number to the style.Tag for each column (e.g. each style in grid.ColumnStyles) at initialization time. Whenever you need the original column index of columns you can then just inspect the style.Tag value. Stefan


TM Trevor Moody September 25, 2003 01:40 AM

> > If you need to keep track of the original position that a column had before the user moved around columns a little trick is to assign the column number to the style.Tag for each column (e.g. each style in grid.ColumnStyles) at initialization time. Whenever you need the original column index of columns you can then just inspect the style.Tag value. > > Stefan > Stefan, thankas for that, nut in order to repopulate the grid, with columns that have been moved around, if only certain rows have changed, the only way to do this would be to populate each cell indivisually. I was hoping the Greid Framework would take care of this. Can any one from Syncfusion comment on this. Thanks Trevor


AD Administrator Syncfusion Team September 25, 2003 05:25 AM

Yes, you will have to the population manually. Just loop through the cells and call SetCellInfo for each cell. That's also what PopulateValues does. Don't use the grid indexer or ChangeCells since that would slow things down. Stefan

Loader.
Live Chat Icon For mobile
Up arrow icon