472,328 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

Binding DataRow Array to ComboBox

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
3 14512
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ben Reese | last post by:
I think that my problem is similar to the one entitled "Subject: Complicated Data Binding Question" of 7/2/2005 Simply: I have a pair of combo...
0
by: Dmitry Karneyev | last post by:
Hi! I've got a binded combobox, currencymanager object and a SelectionChangeCommitted event handler. In event handler I retieve data from a...
1
by: George Durzi | last post by:
Don't know why I'm having trouble with this: Dim arNewsletters As DataRow() = dsPubs.Tables(0).Select("CategoryName = 'Newsletters'") If...
4
by: Tom | last post by:
I have a dataset called "employees" with a field called "gender". How do I bind a combobox to it so that the user is only allowed to select "M" or...
8
by: Richard L Rosenheim | last post by:
I have a dataset containing a parent table related to a child table. The child table contains an ID field (which is configured as autonumber in the...
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for...
4
by: Jim Shaffer | last post by:
Perhaps I have the wrong construct, or misunderstand arrays in vb (2003).... I've loaded a two-dimensional array (168 by 28) into memory as...
8
by: kimtherkelsen | last post by:
Hi, I do this: this.comboBox.DataSource = myDataSet.Tables.Select("location_key = " + selectedLocationKey); this.comboBox.DisplayMember =...
10
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
Hi, Problem: How can I databind (or put) a SqlServer query's row return of 115,000 items into a ComboBox quickly? Not much longer than a matter...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.