Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Grid

Status
Not open for further replies.

JamesHanley

Programmer
Jun 16, 2006
57
US
Quick question with C#.

Button that clears dataGrid1.

or

Button that restarts/reruns application to clear all fields.

Possible?
 
If you want to clear the datagrid to nothing, set its datasource to an empty datasource.

If you want it to retain some kind of formatting, make the datatable have all of the columns that you need, but have no rows.

----------------------------------------

TWljcm8kb2Z0J3MgIzEgRmFuIQ==
 
MessageBox.Show("Please Select New Group To Run Report.");
DataSet lstDataSet = new DataSet();
sla.HRDataSet(lstDataSet, cboApps.Text);
dataGrid1.DataSource = lstDataSet.Tables[""];

This worked awesome thank you. I just set to lstDataSet.Tables[""] instead of [0]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top