V
victor
hi guys
i get a problem with add databinding between a combobox and a dataview
i have a select statement like
string strCmd = String.Format (
"SELECT Customers.CustomerName, " +
"Call.CallID, " +
"Call.CustomerCode, " +
"Call.ScheduleStarted, " +
"Call.ScheduleEnded, " +
"Call.ActualStarted, " +
"Call.ActualEnded, " +
"Call.CallStatusID, " +
"Call.IsDeleted, " +
"CallStatus.Status " +
"FROM Call INNER JOIN Customers " +
"ON Call.CustomerCode = Customers.CustomerCode " +
"JOIN CallStatus ON Call.CallStatusID = CallStatus.CallStatusID ") ;
then i get a dataset dsCall.
then i set my datagrid's datasource to dsCall.tables["Call"].defaultView;
then i set the valuemember and displaymember for the customer combobox and
call status combobox.
now i add the databinding to my program like
public void AddCallDetailDataBinding()
{
this.cboCustomerName.DataBindings.Add("SelectedValue",this.dvCall,"CustomerCode");
this.dpScheduleStartTime.DataBindings.Add("Value",this.dvCall,"ScheduleStarted");
this.dpScheduleEndTime.DataBindings.Add("Value",this.dvCall,"ScheduleEnded");
this.txtAcutalStartTime.DataBindings.Add("Text",this.dvCall,"ActualStarted");
this.txtAcutalEndTime.DataBindings.Add("Text",this.dvCall,"ActualEnded");
this.cboCallStatus.DataBindings.Add("SelectedValue",this.dvCall,"CallStatusID");
}
Now i when i clicked the datagrid, I could view the call infomation in the
new panel. but when i changed the call info in the panel. it could not
change the info in the datagird.
any suggestion??
cheers
victor
i get a problem with add databinding between a combobox and a dataview
i have a select statement like
string strCmd = String.Format (
"SELECT Customers.CustomerName, " +
"Call.CallID, " +
"Call.CustomerCode, " +
"Call.ScheduleStarted, " +
"Call.ScheduleEnded, " +
"Call.ActualStarted, " +
"Call.ActualEnded, " +
"Call.CallStatusID, " +
"Call.IsDeleted, " +
"CallStatus.Status " +
"FROM Call INNER JOIN Customers " +
"ON Call.CustomerCode = Customers.CustomerCode " +
"JOIN CallStatus ON Call.CallStatusID = CallStatus.CallStatusID ") ;
then i get a dataset dsCall.
then i set my datagrid's datasource to dsCall.tables["Call"].defaultView;
then i set the valuemember and displaymember for the customer combobox and
call status combobox.
now i add the databinding to my program like
public void AddCallDetailDataBinding()
{
this.cboCustomerName.DataBindings.Add("SelectedValue",this.dvCall,"CustomerCode");
this.dpScheduleStartTime.DataBindings.Add("Value",this.dvCall,"ScheduleStarted");
this.dpScheduleEndTime.DataBindings.Add("Value",this.dvCall,"ScheduleEnded");
this.txtAcutalStartTime.DataBindings.Add("Text",this.dvCall,"ActualStarted");
this.txtAcutalEndTime.DataBindings.Add("Text",this.dvCall,"ActualEnded");
this.cboCallStatus.DataBindings.Add("SelectedValue",this.dvCall,"CallStatusID");
}
Now i when i clicked the datagrid, I could view the call infomation in the
new panel. but when i changed the call info in the panel. it could not
change the info in the datagird.
any suggestion??
cheers
victor