473,659 Members | 3,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Da taRow"
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 14681
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************ ************@se manticspace.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.Da taRow"
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
datagridcolumns tyle 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 programmaticall y 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************ ************@se manticspace.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.Da taRow"
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*******@disc ussions.microso ft.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
datagridcolumns tyle 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 programmaticall y 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************ ************@se manticspace.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.Da taRow"
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
1330
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 in a parent/child relationship This is easy to do with dataGrid controls ( Where m_Families is a strongly typed dataset with 2 tables, Parents and children and a forign key relationship between them)
0
331
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 retrieved value. The problem is:
1
5075
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 rptNewsletters.DataSource = arNewsletters rptNewsletters.DataBind() End If The code compiles, but if (for the sake of example) my Repeater looks like
4
3792
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 that M and F are not in a table of a database. I have entered them directly into the Items collection of the combobox via the property editor. Thanks
8
3921
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 addition fields. I'm able to get the datagrid to be properly populate with only the child records relating to the specified parent by setting the ..DefaultView.RowFilter property. Currently, to properly add a new child record, I need to manually...
0
4794
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 manually inserted a row in the table bound to the Combo box. The InsertAt Method of adding a row just does not work. Hope this helps anyone with this problem. john
4
23426
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 AcctArray is loaded from a Quickbooks table, so there's no intrinsic dataset to assign as datasource.... I want to have a combo table (or list table or whatever), currently named cbAccounts, that can scroll through and maybe select items in the...
8
11922
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 = "subcustomer_location_key"; but get an exception when setting the value member. Unfortunately there
10
5835
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 rebuilding my company's Access 97 VBA database app. It pulls 115,000 items (of account names) from SqlServer and the data is bound to a single Access 97 ComboBox control. My C# version needs to work exactly like this one. Our executive employees want...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8337
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8531
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8628
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.