I want to set a component height to "*" dynamically in code. How can I do that?
I know how to set it to a defined value:
DataGrid.Height = "500";
And how to set to “Auto”:
DataGrid.Height = Double.NaN;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Star sizing only exists for very few components, the
Griditself is not one of them.GridLengthhas a constructor which takes the type of the sizing sheme as parameter.If you want a component to stretch do not set any value for
Width/Heightand make sure theHorizontal/VerticalAlignmentisStretch.