Tuesday, February 3, 2015

an example of hiding the delete button in DevExpress 13.1.9 grids

Use this event...

MyGrid.HtmlCommandCellPrepared += MyGrid_HtmlCommandCellPrepared;

 
 

...like so:

private void MyGrid_HtmlCommandCellPrepared(object sender,
      ASPxGridViewTableCommandCellEventArgs e)
{
   if (e.CommandColumn.Caption == "Delete")
   {
      if(e.KeyValue.ToString() == ((User)Session["User"]).Username)
      {
         e.Cell.Controls.Clear();
      }
   }
}

No comments:

Post a Comment