protected void Grd_HtmlCommandCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableCommandCellEventArgs e) { if (e.CommandCellType == GridViewTableCommandCellType.Data) { SYS_Right right = (SYS_Right)Session["Right"]; if (right == null) { return; } for (int i = 0; i < e.Cell.Controls.Count; i++) { if (!right.IsCreate) { btnThem.Visible = false; //e.Cell.Controls[1].Visible = false; } if (!right.IsUpdate) { e.Cell.Controls[0].Visible = false; } if (!right.IsDelete) { e.Cell.Controls[1].Visible = false; } } } }
protected void GrdLog_HtmlCommandCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableCommandCellEventArgs e) { if (e.CommandCellType == DevExpress.Web.GridViewTableCommandCellType.Data) { SYS_Right right = (SYS_Right)Session["Right"]; if (right != null) { for (int i = 0; i < e.Cell.Controls.Count; i++) { if (!right.IsDelete && i == 0) { btnDeleteLog.Visible = false; e.Cell.Controls[0].Visible = false; } } // Edit =0; New = 1;Delete =2 } } }
protected void grvPartitionManager_HtmlCommandCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableCommandCellEventArgs e) { //if (e.CommandCellType == GridViewTableCommandCellType.Data) //{ // SYS_Right right = (SYS_Right)Session["Right"]; // for (int i = 0; i < e.Cell.Controls.Count; i++) // { // if (!right.IsCreate && i == 1) // { // btnThem.Visible = false; // } // if (!right.IsUpdate && i == 0) // { // e.Cell.Controls[0].Visible = false; // } // if (!right.IsDelete && i == 1) // { // e.Cell.Controls[1].Visible = false; // } // } //} }