using version 2011 Q1
I have a window with a tree view and a grid
when I change the selected item in the tree i run query, build an ObservableCollection and bind it to the ItemSource of the grid.
all grid columns are Width="Auto"
the problem is that when i rebind the ItemSource, the width of columns don't update correctly, actually they don't update at all.
sometimes a column in the the resulting collection has 200 characters at most, other times 25 characters at most.
the columns width does not re size to correctly to 25 characters, it is left at 200 characters, the columns have too much white-space.
is the grid not supposed to do update the columns when the ItemSource gets a new collection?
if not how can I force the columns to adjust to current data collection.
as in one of your examples i have tried to iterate the grid.Columns setting the width to Auto, nothing happened.
your help would be much appreciated.
thanks
I have a window with a tree view and a grid
when I change the selected item in the tree i run query, build an ObservableCollection and bind it to the ItemSource of the grid.
all grid columns are Width="Auto"
the problem is that when i rebind the ItemSource, the width of columns don't update correctly, actually they don't update at all.
sometimes a column in the the resulting collection has 200 characters at most, other times 25 characters at most.
the columns width does not re size to correctly to 25 characters, it is left at 200 characters, the columns have too much white-space.
is the grid not supposed to do update the columns when the ItemSource gets a new collection?
if not how can I force the columns to adjust to current data collection.
as in one of your examples i have tried to iterate the grid.Columns setting the width to Auto, nothing happened.
your help would be much appreciated.
thanks