Remember
RowSpan
property is only applicable when your control is placed inside a
TableLayoutPanel
, if this is true in that case you can access the
RowSpan
as following.
private void TestGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
int rowSpan = tableLayoutPanel1.GetRowSpan((DataGridView)sender);
}