【发布时间】:2019-08-15 01:28:05
【问题描述】:
我有一个包含许多列的 radgridview(水平滚动条已被激活)。
我的网格中有一个 CommandColumn,我想像这样格式化它:
private void rad_grd_Requests_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement.ColumnInfo is GridViewCommandColumn)
{
RadButtonElement button = (RadButtonElement)e.CellElement.Children[0];
if (e.CellElement.RowInfo.Cells["Admin_Action"].Value.ToString() == "Hold")
{
button.Text = "Done";
}
else
{
button.Text = "Done";
button.Visibility = ElementVisibility.Hidden;
}
}
}
程序启动后一切正常。
但是当我有时使用网格的水平滚动条时,CommandColumn 中的所有按钮都是不可见的。(多次运行 CellFormatting())
为什么 CellFormatting() 不稳定&我该如何解决这个问题?
【问题讨论】:
标签: c# winforms telerik radgridview