如何在telerik asp中选择foreach循环中的所有网格项

时间:2014-06-19 14:31:40

标签: asp.net foreach telerik-grid

此代码显示空值。实际上我在网格计数中有4行,但问题是它显示的是空值。

// loops through each row in RadGrid
foreach (GridDataItem row in RadGrid.MasterTableView.Items) 
{
    Table = Table + row["Columns_Name"].Text.ToString() + " ";
    Table = Table + row["My_data_type"].Text.ToString() + " ";
    Table = Table + row["Col_Primary_Key"].Text.ToString() + " ";
    Table = Table + row["Null_NotNull"].Text.ToString() + "\n,";
}

1 个答案:

答案 0 :(得分:0)

 string value = item.Cells[0].Text; //take the value from the first columns of each row