亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

GridView中動(dòng)態(tài)設(shè)置CommandField是否可用或可見的小例子

 更新時(shí)間:2013年05月08日 11:07:43   作者:  
GridView中動(dòng)態(tài)設(shè)置CommandField是否可用或可見的小例子,需要的朋友可以參考一下
復(fù)制代碼 代碼如下:

 protected void gvMaterial_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header)
            {
                e.Row.Cells[0].Visible = false;

            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Cells[1].Text = (gvMaterial.PageIndex * gvMaterial.PageSize + e.Row.RowIndex + 1).ToString();
                string price;
                try //讓編輯功能在特定條件下可以用
                {
                     price = ((TextBox)e.Row.Cells[4].Controls[0]).Text;//點(diǎn)編輯的時(shí)候用
                }
                catch
                {
                     price = e.Row.Cells[4].Text;    //出始時(shí)用
                }                         
                if (price == "" || price == " ")
                {
                    e.Row.Cells[7].Controls[0].Visible = false;
                }
                else
                {
                    e.Row.Cells[7].Controls[0].Visible = true;
                }
            }
        }
 

相關(guān)文章

最新評(píng)論