I have created a GridViewTextBoxColumn(), on _CellPaint() I am painting three images starting from the left to right. I would like to detect a mouse click on the rectangle that corresponds to the image but I can't get the Cell.Size information on the CellClick() event.
I have tried creating a custom control that holds three buttons but the UI doesn't fit my needs.
In order to determine what was clicked on the cell, I need to know the click x/y and the current cell rectangle.
void grid_CellPaint(object sender, GridViewCellPaintEventArgs e)
GridDataCellElement dataCell = e.Cell as GridDataCellElement;
if (dataCell != null && dataCell.ColumnInfo.FieldName == "ID")
Size cellSize = e.Cell.Size;
Rectangle rct = new Rectangle(0, 0, cellSize.Height, cellSize.Height);
//using (Pen p = new Pen(Color.Black))
rct = new Rectangle(cellSize.Height, 0, cellSize.Height, cellSize.Height);
rct = new Rectangle(cellSize.Height * 2, 0, cellSize.Height, cellSize.Height);