【发布时间】:2011-01-11 13:15:36
【问题描述】:
我有一个以 GridButtonColumn 作为列之一的 radgrid。我需要在 ItemCommand 事件期间更改网格中显示的该列的文本。 例如。 如果在 ItemCommand 事件之后文本为“是”,则应将其更改为“否”。 我们如何实现这一点?
【问题讨论】:
我有一个以 GridButtonColumn 作为列之一的 radgrid。我需要在 ItemCommand 事件期间更改网格中显示的该列的文本。 例如。 如果在 ItemCommand 事件之后文本为“是”,则应将其更改为“否”。 我们如何实现这一点?
【问题讨论】:
见: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";
}
}
}
【讨论】: