Click here to Skip to main content
15,210,734 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello,

How to get RowSpan Property of Datagridview in Cellpainting Event Handler
in Windows Application

Thanks
Lakshman
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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);
       }
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100