data binding

G

Guest

I am using windows forms that have 5 textbox's they are bound as follows:

drvDetail = (DataRowView) cm.Current;
vueDetail = drvDetail.DataView;

this.BindingContext[vueDetail].Position = cm.Position;

txtSON.DataBindings.Add("Text", vueDetail, "service-order-number");
txtTaskID.DataBindings.Add("Text", vueDetail, "taskid");
txtServiceDesc.DataBindings.Add("Text", vueDetail, "task-desc");
txtCompDate.DataBindings.Add("Text", vueDetail, "complete-date");
txtServiceCost.DataBindings.Add("Text", vueDetail, "task-cost");

I fill in the textbox data from a combobox that has the needed data. I see
the data in the textbox but when I save it to the database it does not work
(it appears that the data is not acceped into the textbox). But when I key
in the data it works. Please tell me how to use the generated data?
 
W

W.G. Ryan MVP

Are you calling EndCurrentEdit? If not, the rows aren't considered 'ready'
to be sent back to the DB.
 
G

Guest

Ryan, I was wrong I am not trying to update the database. I am trying to
update a datagrid with the data in the textboxes. Again if I key in the data
its works. If I generate the data for the textboxes it does not work. The
question is how do I get the data to the textboxes so its useable?
--
Norm Bohana


W.G. Ryan MVP said:
Are you calling EndCurrentEdit? If not, the rows aren't considered 'ready'
to be sent back to the DB.
nbohana said:
I am using windows forms that have 5 textbox's they are bound as follows:

drvDetail = (DataRowView) cm.Current;
vueDetail = drvDetail.DataView;

this.BindingContext[vueDetail].Position = cm.Position;

txtSON.DataBindings.Add("Text", vueDetail, "service-order-number");
txtTaskID.DataBindings.Add("Text", vueDetail, "taskid");
txtServiceDesc.DataBindings.Add("Text", vueDetail, "task-desc");
txtCompDate.DataBindings.Add("Text", vueDetail, "complete-date");
txtServiceCost.DataBindings.Add("Text", vueDetail, "task-cost");

I fill in the textbox data from a combobox that has the needed data. I
see
the data in the textbox but when I save it to the database it does not
work
(it appears that the data is not acceped into the textbox). But when I
key
in the data it works. Please tell me how to use the generated data?
 

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