473,287 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 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 14645
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 (dropdown List) boxes that I want to display data...
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 binded field and fill other field using this...
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 (arNewsletters.Length > 0) Then...
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 "F" and that value ends up in the dataset? Note...
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 datatable), the ID of the parent, plus some...
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 'index'." error. Apparently, its caused by having...
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 AcctArray. {Dim AcctArray (500,28) as string...} The...
8
by: kimtherkelsen | last post by:
Hi, I do this: this.comboBox.DataSource = myDataSet.Tables.Select("location_key = " + selectedLocationKey); this.comboBox.DisplayMember = "text"; this.comboBox.ValueMember =...
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 of seconds, that is... Scenario: I am...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.