Questions tagged [gridlength]
14 questions
25
votes
1 answer
How to use WPF's asterisk size value in codebehind?
I create some control in codebehind and would like to set its size dynamically.
I can assign numerical values as well as System.Windows.GridLength.Auto, but there is no equivalent to "*".
Is that because the "*" from XAML gets translated into code…

Martin Hennings
- 16,418
- 9
- 48
- 68
13
votes
1 answer
C# WPF - GridLength GridUnitType.Auto
Can anyone explain the difference between using:
GridLength length = new GridLength(0, GridUnitType.Auto)
and
GridLength length = new GridLength(1, GridUnitType.Auto)
My limited knowledge of this leads me to believing these would both be…

shann1990
- 133
- 1
- 1
- 7
5
votes
1 answer
How to discrete animate GridLength from "Auto" to "*"?
I need to animate this property using a Storyboard.
Is writing your own animation is a best choice?

Sergey Aldoukhov
- 22,316
- 18
- 72
- 99
3
votes
2 answers
int to System.Windows.GridLength - VB.NET
How can I convert int to System.Windows.GridLength in VB, NET so that I can set the height of a grid row in Silverlight (xaml).
In xaml file:
In VB.NET:
rowerror.Height = CType(30,…

eriksv88
- 3,482
- 3
- 31
- 50
3
votes
1 answer
WPF GridLength in XAML
I'm trying to define a common Width resource in Common.xaml which will be shared by different controls, like following:
20
I then use it in a Button style defined in ButtonStyle.xaml