This is a migrated thread and some comments may be shown as answers.

Get columns value

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Liu Yan
Top achievements
Rank 1
Liu Yan asked on 07 Aug 2008, 05:34 AM
Hi,

    I have a Radgrid and a botton.when click botton,I want to get all rows value of columns.Can you help me? thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Aug 2008, 06:21 AM
Hi Liu Yan,

To loop through every cell in the Grid, you can try out the following code snippet.

cs:
protected void Button1_Click(object sender, EventArgs e) 
    { 
       foreach (GridColumn col in RadGrid4.MasterTableView.RenderColumns) 
        { 
          foreach (GridDataItem item in RadGrid4.MasterTableView.Items) 
            { 
              string strTxt=item[col.UniqueName].Text.ToString(); 
            } 
        }        
    } 

Thanks
Princy.
Tags
Grid
Asked by
Liu Yan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or