data binding

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
Are you calling EndCurrentEdit? If not, the rows aren't considered 'ready'
to be sent back to the DB.
 
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?
 
Back
Top