ComboBox Items problem

G

Guest

Hi....I have a problem with the combobox it's that it show the System.Data.DataRowView in the ListItems...What is the problem if a set my combobox with a datatable and that datatable have the data to show
 
G

Guest

I have this code

Dim dsTemp As New DSSearchDat
Dim rowSetting As DataRo
Dim rowField As DataRo
Dim _SearchFieldTable As DataTabl
dsTemp.Merge(_DSSearchData

For Each rowField In dsTemp.search_field.Row
rowSetting = _DSSearchSettings.selected_search_field.FindBysearch_field_id(rowField("search_field_id")
If rowSetting Is Nothing OrElse Not rowSetting("visible_flag") The
rowField.Delete(
End I
Nex
_SearchFieldTable = dsTemp.search_fiel

cbxField.DisplayMember = "field_caption
cbxField.ValueMember = "search_field_id
cbxField.DataSource = _SearchFieldTabl

My datatable variable is "_SearchFieldTable" but when I bind this datatable with my combobox "cbxField.DataSource" it doesn't show anything just "System.Data.DataRowView" like item in my combo...

My datatable have 9 item when i saw the .Rows.Count valu

Can u help me??? please...
 
B

Ben S. Stahlhood II

Johny,

What Ken was trying to tell you is that the DisplayMember value must match
exactly, case and all.
Make sure where you specify "field_caption" as your Display Member, that is
matches exactly in case to the field name in your Data Table.

Regards,
Ben S. Stahlhood II

Johny Segura said:
I have this code:

Dim dsTemp As New DSSearchData
Dim rowSetting As DataRow
Dim rowField As DataRow
Dim _SearchFieldTable As DataTable
dsTemp.Merge(_DSSearchData)

For Each rowField In dsTemp.search_field.Rows
rowSetting = _DSSearchSettings.selected_search_field.FindBysearch_field_id(rowField("sear
ch_field_id"))
If rowSetting Is Nothing OrElse Not rowSetting("visible_flag") Then
rowField.Delete()
End If
Next
_SearchFieldTable = dsTemp.search_field

cbxField.DisplayMember = "field_caption"
cbxField.ValueMember = "search_field_id"
cbxField.DataSource = _SearchFieldTable

My datatable variable is "_SearchFieldTable" but when I bind this
datatable with my combobox "cbxField.DataSource" it doesn't show anything
just "System.Data.DataRowView" like item in my combo....
 

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