Hi what I want to do is after hte user has dragged a column into a new position in the grid is rewrite my datatable with the new positions of the columns and then their corresponding rows. I know that sounds simple enough but having trouble finding the answer.
Any help appreciated. Thanks.
Basically, because i was given a requirement that when exporting to excel (our own code not infragistics)
that the columns be in the order they had arranged. I was already planning on copying the columns and
rows to a new datatable, then copying that table to the table that is the datasource for the grid. I just am having
trouble reading the grid and the columns to do this. I have no such problem in row filtering.
I suspect another problem I am going to run into is if the grid has a filter applied how I am going be able to
reassign that.
Thank you for your help on this.
Hi,
May I ask why you want to recreate your data table? This seems like an odd thing to do based on the column positions in the grid?
I don't think a DataTable has any easy way to rearrange columns, so you would probably have to remove the columns and re-add then. This would be a massive change to the data structure and cause all sorts of notification to be sent to bound controls, which would then get reset and probably lose their current state information.
Hello,
Show me what you are saying in writing the columns to a new datatable please. I tried this and it kept giving me the first column.
Use AfterColPosChanged and check the VisiblePosition property of the column header