在gridview里面的rowdatabound事件里面如何获得行数 !我要实现系统管理员那行的编辑按钮不显示 if ( e.Row.Cells[0].Text == "asdf2")
{
e.Row.Cells[3].Text = "";
e.Row.Cells[4].Text = "";
e.Row.Cells[5].Text = "";
}
我是这样写的,但是取出来的却是第一列的标题列而不是内容页,该怎样实现阿,谁有代码阿
{
e.Row.Cells[3].Text = "";
e.Row.Cells[4].Text = "";
e.Row.Cells[5].Text = "";
}
我是这样写的,但是取出来的却是第一列的标题列而不是内容页,该怎样实现阿,谁有代码阿
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
this.gv1.Rows[0].Cells[3].Text = "";
this.gv1.Rows[0].Cells[4].Text = "";
this.gv1.Rows[0].Cells[5].Text = "";
}
}
if (e.Row.DataItemIndex == 0)
{
e.Row.Cells[3].Text = "";
e.Row.Cells[4].Text = "";
e.Row.Cells[5].Text = "";
}