FineUI 官方论坛
标题:
求助:Grid中LinkButtonField列的Enabled问题
[打印本页]
作者:
烟波蓝
时间:
2013-6-26 12:49
标题:
求助:Grid中LinkButtonField列的Enabled问题
在cs页中设置Grid的LinkButtonField列的可用性,第一行数据不起作用,大致为以下意思:
protected void Grid_OutPutData_RowDataBound(object sender, FineUI.GridRowEventArgs e)
{
FineUI.LinkButtonField LinkButtonField_up = this.Grid_OutPutData.FindColumn("LinkButtonField_up") as FineUI.LinkButtonField;
if (HiddenField_cstate.Value == "0")
{
LinkButtonField_up.Enabled = true;
}
else
{
LinkButtonField_up.Enabled = false;
}
}
复制代码
作者:
luyj56
时间:
2013-6-28 10:33
在PreRowDataBound 事件中设置。参考下:
protected void Grid1_PreRowDataBound(object sender, FineUI.GridPreRowEventArgs e)
{
WindowField lbedit = Grid1.FindColumn("lbedit") as WindowField;
LinkButtonField lbdel = Grid1.FindColumn("lbdel") as LinkButtonField;
DataRowView row = e.DataItem as DataRowView;
string lstid = row["stid"].ToString();
if (lstid == "0")
{
lbedit.Enabled = true;
lbedit.DataIFrameUrlFormatString = "StudentMX.aspx?stid={0}&parid={1}";
lbedit.IconUrl = "../images/tag_blue.png";
lbedit.ToolTip = "修改";
lbdel.Enabled = true;
lbdel.IconUrl = "../images/delete.png";
lbdel.ToolTip = "删除";
}
else
{
lbedit.DataIFrameUrlFormatString = "StudentView.aspx?stid={0}";
lbedit.IconUrl = "../images/tag_purple.png";
lbedit.ToolTip = "查看";
lbdel.Enabled = false;
lbdel.IconUrl = "../images/delete_disabled.png";
lbdel.ToolTip = "不可删除";
}
}
欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/)
Powered by Discuz! X3.4