This sample demonstrates the implementation of Cell Comment Tipin GridDataBoundGrid.
Features:
The GridDataBoundGrid just displays the values from the DataSource. It doesn't store any cell style properties apart from the cell text. You have to provide such properties on demand through Model.QueryCellInfo. To have Excel comment tips for the cells, you can have a hashtable to maintain the comments for each cell. You can provide the comments in Model.QueryCellInfo and if edited by users, you can store this in Model.SaveCellInfo.
The comment text is stored in a hashtable.
To change, add, or delete a cell comment, you have to click the cell using right mouse button, or click the red flag at the top right corner. A context menu with options pops up. The required option can be selected to perform respective operations.
The comment window displayed is a form with a rich text box.
A red comment indicator is drawn in the cell-drawn handler using the graphics class FillPolygon function.
A black arrow is drawn when the mouse pointer is hovered over the comment indicator using the graphics class FillPolygon and DrawLine function.
When the mouse pointer hovers over the comment indicator through the PointToRowCol function, it is converted to a row index on the layout using the ViewLayout.RowIndexToVisibleClient. Then it is converted to drawing points using the ViewLayout.ClientRowColToPoint function.