I am trying to reorder some columns in the GridView, based on their name. I have 25 columns, and they reorder, but not in the order they are suppose to. Can you give any insight why they are in the wrong order?
public static void ReorderColumns(this RadGridView gridView, params string[] columnNames)
{
for (int i = 0; i < columnNames.Length; i++)
{
string currentName = columnNames[i];
GridViewDataColumn column = (GridViewDataColumn)gridView.Columns[currentName];
int oldIndex = gridView.Columns.IndexOf(column);
gridView.ReorderColumns(oldIndex, i);
}
}