开发者

Set value column value of the selected row in RadGrid

开发者 https://www.devze.com 2023-02-07 20:39 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号