By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,198 Members | 950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,198 IT Pros & Developers. It's quick & easy.

Binding DataRow Array to ComboBox

P: n/a
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.
Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Shravan" <sh************************@semanticspace.com> wrote in message
news:09****************************@phx.gbl...
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.

Nov 15 '05 #2

P: n/a
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.
-----Original Message-----
Hi,

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

--
Miha Markic - RightHand .NET consulting & software developmentmiha at rthand com

"Shravan" <sh************************@semanticspace.com> wrote in messagenews:09****************************@phx.gbl...
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.

.

Nov 15 '05 #3

P: n/a
Hi,

You might fill it manually, I presume...

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

<an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
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.
-----Original Message-----
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?

--
Miha Markic - RightHand .NET consulting & software

development
miha at rthand com

"Shravan" <sh************************@semanticspace.com>

wrote in message
news:09****************************@phx.gbl...
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.

.

Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.