DataGrid and DataSet

G

Guest

Hi,

I have dataGrid which at first it's empty. i have another dataGrid which
contains checkbox column, what i want to do is, that everytime a checkbox is
checked, my dataGrid will be filled with data. So my question is, Is it
possiable to add a data to dataSet without erasing the data that exists
already?

I take the data from my dataBase, so if there is a better way to add data to
my dataGrid everytime a checkbox is check, i will happu to hear and learn.

Thanks,
Gidi.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

What youi have is a Master/Detail scenario, you can find several examples
in msdn.microsoft.com

Using DataAdapter.Fill you can add the new rows to your dataset, there are a
couple of details regarding PKs , etc that you can check in the help of the
Fill method.


after that you just do a
datagrid1.DataSource = theDataSet ;
datagrid1.Bind

to refresh the datagrid


cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top