I have a TDBGrid and have a Client dataset associated through a TDataSource. When i try to re-arrange the columns of the grid programtically this works fine when there are one or more columns in the grid.
Lets say, i made all the columns visible to false. So, the grid does not have any columns yet. Now, when i set the Index of column at 11 to 0.
Columns[iColIndx].Index := iNewColIndex;
// Assume iColIndx = 11 and iNewColIndex = 0
Columns[iNewColIndex].Visible := True;
//Making the column visible
The above assignment of column index is not getting reflected in the Grid. If i try setting it for twice or thrice, then it is getting reflected. Am i missing anything?