tjgilbert
asked on
wpf xceed DataGrid, C#
I am using the wpf xceed DataGrid and binding data to the Data Grid Control.
ItemsSource="{Binding Path=GetData}"
I am using C# and MVVM and the GetData is in my ViewModel file.
I am unable to clear the grid by passing null. It removes the rows but the columns stay bounded somehow.
I appreciate any suggestions you have.
tjgilbert
ItemsSource="{Binding Path=GetData}"
I am using C# and MVVM and the GetData is in my ViewModel file.
I am unable to clear the grid by passing null. It removes the rows but the columns stay bounded somehow.
I appreciate any suggestions you have.
tjgilbert
ASKER
The problem is I'm not using code behind so I don't have access to the datagrid directly. I am using View Model.
I have passed null and I have tried passing an empty DataTable.
neither works.
Do you have any other suggestions?
I have passed null and I have tried passing an empty DataTable.
neither works.
Do you have any other suggestions?
Is your GetData still get the rows ? GetData should return null as itemsource
View Model isnt pssing null there its pass collection with none items, but still keeps structure.
Actualy i have no idea how to pass null there from bindings.
Actualy i have no idea how to pass null there from bindings.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
x.ItemSource = new List<object>();
or call clear on x.Columns.Clear();
----------------
x is your datagrid name