Bindingsource Question
-
Hi, I have a bindingsource binding to several text controls. I want to use the bindingsource.addnew() method to add a new line in the list, then move to the last record. My purpose is to set all these text controls empty to wait for input for the last record. But it failed. The bindingsource.position can not been set to the last record. :( Could you please help to solve this problem? thanks.
-
Hi, I have a bindingsource binding to several text controls. I want to use the bindingsource.addnew() method to add a new line in the list, then move to the last record. My purpose is to set all these text controls empty to wait for input for the last record. But it failed. The bindingsource.position can not been set to the last record. :( Could you please help to solve this problem? thanks.
to do this I think you should do the following:
DatRow dr = dsCustomerDataset.Customers.NewCustomerRow();
dr[0] = "";
dr[1] = "";
dsCustomerDataset.Customers.AcceptChanges();then since you fill the binding source with your data set when you use the bindingSource.MoveLast() method it will fill your controls with empty data row which you'll add. hope this will help you!
Qendro
-
to do this I think you should do the following:
DatRow dr = dsCustomerDataset.Customers.NewCustomerRow();
dr[0] = "";
dr[1] = "";
dsCustomerDataset.Customers.AcceptChanges();then since you fill the binding source with your data set when you use the bindingSource.MoveLast() method it will fill your controls with empty data row which you'll add. hope this will help you!
Qendro
Thanks Qendro. It helps.