开发者

how to change radgrid's GridButtonColumn's text in radgrid's ItemCommand event?

开发者 https://www.devze.com 2023-02-03 20:21 出处:网络
I开发者_运维知识库 have a radgrid with GridButtonColumn as one of the column.I need to change that column\'s text displayed in the grid during ItemCommand event.

I开发者_运维知识库 have a radgrid with GridButtonColumn as one of the column.I need to change that column's text displayed in the grid during ItemCommand event. for eg. if text is 'yes' after ItemCommand event, it should be changed to 'no'. How we can implement this?


See: How to change GridButtonColumn image/text at runtime

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
{ 
    if (e.Item is GridDataItem) 
    { 
        GridDataItem item = (GridDataItem)e.Item;
        LinkButton lbutton = item["ButtonUniqueName"].Controls[0] as LinkButton;
        if (lbutton.Text == "yes") 
        { 
           lbutton.Text = "no";
        } 
    } 
} 
0

精彩评论

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