Wednesday 26 June 2013

Clear A Datagrid On A Button Click

Tags

How to clear a datagrid on a button click?

You need to Clear the DataSource of the dadaGrid.

So try this:

dataSet1.Clear();
dataGrid1.DataSource = dataSet1.TableNameHere.DefaultView;
or

C#: dataGrid1.DataSource = null;

VB: dataGrid1.DataSource = nothing


EmoticonEmoticon