locked
Rad Grid iteration by column RRS feed

  • Question

  • User1192570106 posted

    Hi All,

    I am using Rad grid and requirement is iterate grid by column not row(GridViewItem) on a button click event using C#.

    Can anyone have idea.

    Thanks in advance.

    Wednesday, December 20, 2017 9:52 PM

All replies

  • User2103319870 posted

    I am using Rad grid and requirement is iterate grid by column not row(GridViewItem) on a button click event using C#.

    For GridBoundColumn you could use the GridDataItem and access the column cell by its UniqueName and retrieve the value from the cell's Text property

    //loop thorugh each items in RadGrid
                foreach (GridDataItem item in RadGrid1.Items)
                {
                    //Get the cell value based on column name
                    //Change ID to your cell unique name
                    string id = item["ID"].Text;
                }

    You can refer this article for more details

    Wednesday, December 20, 2017 10:08 PM
  • User2103319870 posted

    if above code didnt fix your issue, then you might consider posting the question on Telerik Forums

    Wednesday, December 20, 2017 10:09 PM