how to reset datagridview

S

sg_pl

Hi

I have a dataGridView, textBox, button RESET and label. When I change
text in TextBox the dataGridView is filtering and I see only this date
where text in field "name" is text in TextBox and when I click on the
row, in label I see date from field "name" in checked row.

DataView view = (DataView)this.klienciBindingSource.List;
string str = szukajklienta.textBox1.Text;
view.RowFilter = "nazwa" + " Like '" + str + "%'";
dataGridView1.DataSource = view;

when I push the button RESET I would like to reset the dataGridView to
Default view which all date. How can I to do it. I'm testing this:
DataView view = (DataView)this.klienciBindingSource.List;
view.RowFilter = "";
dataGridView1.DataSource = view.Table.DefaultView;
and it's work but when I checked another row the date in label don't
changed.

Thanks for any help.
Regards
Sebastian
 

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