I need to flush my datagrid everytime when a treeviewitem is clicked. My code is given below.
datagrid
treeviewitem
private void treeView1_SelectedItemCh
You may consider using ObservableCollection<> class rather than IEnumerable<>.
ObservableCollection<>
IEnumerable<>
ObservableCollection users = new ObservableCollection(); dataGrid1.ItemsSource = users;
You can clear the datagrid by using the below code.
users.Clear();