Is there a quick way of looping through all columns in a grid in DisplayIndex order?
Something like:
for (int i = 0; i < MyGrid.Columns.Count - 1; i++)
{
GridViewColumn myCol = TiltaksGrid.Columns.DisplayIndex[i];
//process myCol...
}
Thanks!
2 Answers, 1 is accepted
0
Accepted
Dimitrina
Telerik team
answered on 09 Mar 2015, 12:33 PM
Hi,
You can use a foreach instead. For example:
foreach (GridViewDataColumn item in MyGrid.Columns.OfType<GridViewDataColumn>().OrderBy(x=>x.DisplayIndex))
{
...
}
Regards,
Dimitrina
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.