Clear datagrid values in wpf

后端 未结 7 1464
粉色の甜心
粉色の甜心 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:02

    I have tried several approaches and this was by far the best and most reliable one:

    dataGrid.Columns.Clear();
    dataGrid.Items.Clear();
    dataGrid.Items.Refresh();
    

提交回复
热议问题