Link to home
Start Free TrialLog in
Avatar of rajeeva_nagaraj
rajeeva_nagaraj

asked on

WPF datagrid column width

Hi,

I am using wpf data grid in one of my projects, i am setting the column width from my xaml.cs file

datagrid.columns[0].width = 100;
datagrid.columns[1].width = 200;

Now when i drag the column and increase the column width, check the column width it is still displaying me the old column width i.e. 100 and 200. But it should have given me the new column width as i have dragged the column and increased the width.

Can anyone help me in finding a way out of this.

Thanks,
Rajeeva
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Is this real code? C# is case sensitive and "columns" does not exist for sure! Have you tried ActualWidth?
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial