Access to Grid Column's value

2 posts, 0 answers
  1. Armen
    Armen avatar
    9 posts
    Member since:
    May 2009

    Posted 05 May 2009 Link to this post


    I would like on the postback loop the RadGrid and get the value of particular column like ("Column1") for each rows.
    something like 




    protected void but1Click(object sender, EventArgs e)


        foreach (GridItem item in RadGrid1.MasterTableView.Items)


                if (item is GridDataItem)


                GridDataItem eItem = item as GridDataItem;

                string svalue = eItem.GetDataKeyValue("Column1")




    It seems like "GetDataKeyValue" is not right way to get the value.



    What is the efficient way to get the value of each Column?

    Thank you

  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 05 May 2009 Link to this post

    The correct way to programmatically access column values is:

    var dataitem = item as GridDataItem;
    var value = dataitem["ColumnName"];

    You can see more details in this online help article:

    Hope that helps!
  3. Telerik UI for ASP.NET Core is out
Back to Top