Use the .HtmlDataCellPrepared event like so:
private void MyGrid_HtmlDataCellPrepared(object sender,
ASPxGridViewTableDataCellEventArgs e)
{
if (e.DataColumn.FieldName == "Admin")
{
e.Cell.Controls.Clear();
if ((bool)e.CellValue)
{
var activeImage = new ASPxImage()
{
ImageUrl = "/whatever.png"
};
e.Cell.Controls.Add(activeImage);
} else {
var activeImage = new ASPxImage()
{
ImageUrl = "/somethingelse.png"
};
e.Cell.Controls.Add(activeImage);
}
}
}
No comments:
Post a Comment