G
Geraldine Hobley
Hello,
I have a problem binding a combo box to a datasource.
The datasource is called dsstatus and consists of two
columns Projectstatuskey and ProjectStatus
The displaymember is projectstatus (all the descriptions)
All the fields on the form are bound to a class called
projList
a normal text field is bound as follows
MyProjectInfo.ProjectCode.DataBindings.Add("text",
ProjList, "Projectcode")
This works fine.
MyProjectInfo.cmbStatus.DataSource = dsStatus.Tables!
Projectstatus.DefaultView
However I wish to bind the valuemember of the combobox
cmbstatus like below and I just get an error message
saying that I cannot bind to valuemember. If I bind to
text in the combo field it just displays the index keys
and not the desciptions and it is not updated when I
select a value from the dropdown list.
MyProjectInfo.cmbStatus.DataBindings.Add("ValueMember",
ProjList, "status")
'list works fine'
MyProjectInfo.cmbStatus.DisplayMember = "ProjectStatus"
Any ideas would be appreciated
Geraldine.
I have a problem binding a combo box to a datasource.
The datasource is called dsstatus and consists of two
columns Projectstatuskey and ProjectStatus
The displaymember is projectstatus (all the descriptions)
All the fields on the form are bound to a class called
projList
a normal text field is bound as follows
MyProjectInfo.ProjectCode.DataBindings.Add("text",
ProjList, "Projectcode")
This works fine.
MyProjectInfo.cmbStatus.DataSource = dsStatus.Tables!
Projectstatus.DefaultView
However I wish to bind the valuemember of the combobox
cmbstatus like below and I just get an error message
saying that I cannot bind to valuemember. If I bind to
text in the combo field it just displays the index keys
and not the desciptions and it is not updated when I
select a value from the dropdown list.
MyProjectInfo.cmbStatus.DataBindings.Add("ValueMember",
ProjList, "status")
'list works fine'
MyProjectInfo.cmbStatus.DisplayMember = "ProjectStatus"
Any ideas would be appreciated
Geraldine.