Binding DataRow Array to ComboBox

S

Shravan

Hi,
How can I bind DataRow array to ComboBox.
I tried setting

DataSource -> DataRow Array
DisplayMember -> ColumnName

But it was showing
"System.Data.DataRow"
for every item in the combobox instead of fetching the
value from the row using the given column name.

Can anybody suggest me how to get it correctly.

Thanks,
Shravan.
 
M

Miha Markic

Hi,

Row is an object which has no ColumnName member (it has the field with that
name).
Why don't you rather bind DataTable, or, if you just need some rows -
DataView?
 
G

Guest

Hi Miha,
The problem is that we are binding the combo to a
dataview whose table has a list of items, the combo is
datagridcolumnstyle of type combo, in the grid we are
adding items, whenever an item is added to the grid, user
has to change the row, then in the combo list the item
already assigned is removed, this is done using a DataView
whose filter filters the added row (by changing one column
of the row which is in the filtered column), setting the
values in the table, filter being applied on the dataview
internally, something is causing that sometimes the
changed row corresponding item is not allowed to be
selected in the combo programmatically using selectedindex.


Thanks,
Shravan.
 

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