Click here to Skip to main content
15,896,359 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there any way to get height of the grid in wpf, created dynamically at run time? I don't want to set fix height of grid, so i am not set height of grid.

I have already tried for ActualHeight and DesiredSize.Height, but it doesn't work to get height of the grid.

I have declared one grid in xaml file;

<grid name="grd_Dispaly">

Then in code behind, i have generated rows and columns dynamically and add it in to the grid.

After adding each row in grid, i want to measure height of the grid.
Posted
Updated 5-Jan-10 17:38pm
v2

1 solution

Use the ActualWidth and ActualHeight properties to get the sizes.
 
Share this answer
 
Comments
robertwharvey 13-Feb-19 12:11pm    
That only works if the grid does not extend beyond the viewable area of the screen.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900