C
Cincy Steve
Guest
I have a derived DataGridView with an override method for OnCellEnter. In that method, I execute this statement: this.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true);
Whats coming back is the cell rectangle for row e.RowIndex + 1. If I change the statement to instead pass in e.Rowindex -1, I get the correct cell rectangle. Thats true even when e.RowsIndex = 0.
The MSDN Library GetCellDisplayRectangle documentation (http://msdn.microsoft.com/en-us/lib...idview.getcelldisplayrectangle(v=vs.110).aspx) says it throws an exception when the RowIndex is LESS THAN -1, meaning -1 is OK.
Am I supposed to pass in RowIndex - 1 (which the documentation doesnt say) or am I missing something?
Oh, and one other question. Any idea why the height of the cell rectangle in the first row of the dgv is more than the cells in all the other rows? In my case, the first row has a height of 28, while all other rows have 22. I do not format the rows and the DataTable that gets bound to the dgv contains the same type of data in row 0 as in the remaining rows.
Thanks.
Continue reading...
Whats coming back is the cell rectangle for row e.RowIndex + 1. If I change the statement to instead pass in e.Rowindex -1, I get the correct cell rectangle. Thats true even when e.RowsIndex = 0.
The MSDN Library GetCellDisplayRectangle documentation (http://msdn.microsoft.com/en-us/lib...idview.getcelldisplayrectangle(v=vs.110).aspx) says it throws an exception when the RowIndex is LESS THAN -1, meaning -1 is OK.
Am I supposed to pass in RowIndex - 1 (which the documentation doesnt say) or am I missing something?
Oh, and one other question. Any idea why the height of the cell rectangle in the first row of the dgv is more than the cells in all the other rows? In my case, the first row has a height of 28, while all other rows have 22. I do not format the rows and the DataTable that gets bound to the dgv contains the same type of data in row 0 as in the remaining rows.
Thanks.
Continue reading...