Hi
Need help with a custom command button I would like to show/hide it according to grid data.
for each row whenever the data in the cell "status" == 'pending" show button else hide button.
C#protected void grid_HtmlCommandCellPrepared(object sender, ASPxGridViewTableCommandCellEventArgs e)
{
if (e.CommandCellType == GridViewTableCommandCellType.Data && e.CommandColumn.Name == "Goedkeuren")
{
var rowdata = ((ASPxGridView)sender).GetRowValues(
e.VisibleIndex, FacturatiebonControler.FacturatiebonStatusColumnName);
if (rowdata != null)
{
string status = rowdata.ToStringValue();
if (status == "Pending") e.CommandColumn.CustomButtons[0].Visibility = GridViewCustomButtonVisibility.AllDataRows;
else e.CommandColumn.CustomButtons[0].Visibility = GridViewCustomButtonVisibility.Invisible;
}
}
}
My code now but that does not work don't know what I'm doing wrong?