I know If i want to reorder Radgridview columns, I should use : Radgridview1.Columns.Move(lastIndex , Newindex)
But I need to reorder columns at runtime and save the changes for the next run.
So I can use 2 buttons : MoveForward , MoveBackward.
And I can define 2 integer values in My.settings : LastIndex, NewIndex. (every column has these 2 integer values in my.settings)
plus, I need to have a combo box to select the current column.
As the Move function requires both the current index and desired index , it makes it a bit complicated with the combo Box and buttons. Because when I select and move a column no matter forward or backward (when combo box value is 1 , means the first column is out target to move), the current index should be updated with the desired index. For Example :
Column 1 is in index 0. Now I want to reorder in order to place it in Index 1. So :
I select value "1" in combo box, and then
.columns.move(combobox.text , combobox.text + 1)
So what happens next ? If I'm about to move it 1 more index forward, then the above code should be ? How can I save latest changes in My.settings (the integer values we defined from the beginning)
What is your approach ?
Thanks for your attention.