Clear datagrid values in wpf

后端 未结 7 1463
粉色の甜心
粉色の甜心 2021-01-11 19:14

I need to flush my datagrid everytime when a treeviewitem is clicked. My code is given below.

private void treeView1_SelectedItemCh         


        
7条回答
  •  臣服心动
    2021-01-11 20:13

    I was able to clear my Data-Grid by setting the DataContext to null.

    DataGrid.DataContext=null;
    

提交回复
热议问题