Set value column value of the selected row in RadGrid
I need to set the value of a particular column of the selected row in my telerik RadGrid. I have tried the following, but it didn't work.
foreach (GridDataItem r开发者_JAVA技巧ow in RadGrid1.Items)
{
if (row.Selected)
{
row["MessageStatus"].Text = myMsg.MessageStatus;
break;
}
}
RadGrid1.Rebind();
You can change the text (value) of cells in RadGridView when looping over them in the following way
using (this.radGridView1.DeferRefresh())
{
foreach (GridViewRowInfo row in this.radGridView1.Rows)
{
row.Cells["ColumnUniqueName"].Value = "Some Value";
}
}
Hope that helps
精彩评论