1

I set up a RadGridView and setup 2 Columns at Design Time and then added some GridViewComboBoxColumns programmatically. Now I want to reorder the columns, so that the first 2 columns are at the end.

I tried:

private void Grid_Standort_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
        {
            Grid_Standort.Columns.Move(0, 5);
            Grid_Standort.Columns.Move(1, 6);
            Grid_Standort.Columns.Move(2, 0);
            Grid_Standort.Columns.Move(3, 1);
            Grid_Standort.Columns.Move(4, 2);
            Grid_Standort.Columns.Move(5, 3);
            Grid_Standort.Columns.Move(6, 4);
        }

But that doesn't change anything.

ckay
  • 66
  • 1
  • 12
  • This code works just fine on my end. Make sure to post a whole sample where the issue can be reproduced. – checho May 31 '16 at 06:31

1 Answers1

1
  1. Instead in the DataBindingComplete, execute this code on a simple button click and see if it works.
  2. If it works, you can see if the DataBindingComplete event is fired at all.
  3. If it is, then you need to move the code in a later event e.g. Form.Shown

Lastly, you can try the Insert method of the Columns collection:

radGridView1.Columns.Insert(index, column);
checho
  • 3,092
  • 3
  • 18
  • 30
  • Thank you, the programmatically added columns weren't available at DataBindingComplete, so moving the reordering to Form.Shown has worked. – ckay Jun 06 '16 at 09:55