10288 : Images in _some_ cells depending on other values

Question

Is it possible, based on a value in a cell, to have or not have an image in another cell on that row?
For example: I want to display a picture in the first cells of a row, but only when the second cell of that row is checked.

Answer

If you use the CellType.CustomCell and implement the OnCustomCellDraw event you can draw you image depending on values in any other cell. Use the argument e.Cell.Node to navigate to another cell in that row; e.Cell.Node.GetCell(2).Content.Value’

Sample code for CustomCellDraw:

private void grid1_OnCustomCellDraw(PlexityHide.GTP.Grid aGrid, PlexityHide.GTP.CustomCellEventArgs e)
{
  e.G.DrawArc(new Pen(Color.Red,3),e.DrawRect,0,180);
  e.G.DrawArc(new Pen(Color.Purple,3),e.DrawRect,180,180);
}

 

Leave a Reply