Click here to Skip to main content
16,014,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i fill dataGrid in wpf application dataGrid1.ItemsSource = ds.DefaultView; but i want to remove data from this datagrid and again fill datagrid any oan can help me
Posted

1 solution

Do you mean that you're trying to clear the items in the Datagrid and then load the data from another dataset?

If that's the case, something like:

if(datagrid.itemsource != null)
    datagrid.itemsource = null;


and then provide a new datasource like you're already doing above:

dataGrid1.ItemsSource = ds.DefaultView;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900