Reputation: 31
I would like to replace the following xaml code:
<Custom:DataGridTextColumn Header=" " Width="*"/>
in codebehind. This xaml code fills my header to the end with my style.
This is what I want to get:
|name | number | this area uses "mystyle" end of grid ->|
This is what I currently get:
|name | number | unstyled area! end of grid ->|
As you see, I would like to fill the unstyled area with my style, done this with xaml:
<Custom:DataGridTextColumn Header=" " Width="*"/>
Now I need it in cb please. ;)
Upvotes: 1
Views: 5544
Reputation: 912
Ok I know this is kind of late but I just had the same problem and I solve the problem using DataGridLengthUnitType.Star (well actually I use Grid but it should be the same)
tc.Width = New DataGridLength(2.0, DataGridLengthUnitType.Star); // this will make the colum to be twice as big as the others
Upvotes: 3
Reputation: 29120
tc.Width = New DataGridLength(1.0, DataGridLengthUnitType.Auto);
Upvotes: 0