473,387 Members | 1,573 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,387 software developers and data experts.

Is this a bug with DataSourced ComboBox?

I created a ComboBox and used one of my DataTables as the DataSource. I set
the DisplayMember to the column of the text I want shown to the user while I
set the ValueMember to the ID column.

I then started to test it when I realized I'm getting the wrong ID for the
textI choose in the ComboBox...

It turns out that if you sort ComboBox, the DisplayMembers get sorted but
the ValueMembers do not reflect this change in order, they continue to map to
the same IDs previously...

Any workaround for this?

Maybe this is fixed in the latest version of .NET, I'm still using 1.1
Nov 16 '05 #1
1 1098
Might be a bug yeah.
As a workaround, why not bind to the default dataview and set the sorting on
that instead.
Hope that helps.

--
John Wood
Blog: http://spaces.msn.com/members/johnwood
"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:D1**********************************@microsof t.com...
I created a ComboBox and used one of my DataTables as the DataSource. I set
the DisplayMember to the column of the text I want shown to the user while
I
set the ValueMember to the ID column.

I then started to test it when I realized I'm getting the wrong ID for the
textI choose in the ComboBox...

It turns out that if you sort ComboBox, the DisplayMembers get sorted but
the ValueMembers do not reflect this change in order, they continue to map
to
the same IDs previously...

Any workaround for this?

Maybe this is fixed in the latest version of .NET, I'm still using 1.1

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Mr. B | last post by:
Here's the situation... You've a combobox with Items already added. Say they look like this (or even lines of text): 10-00-232 10-00-256 10-01-006 10-01-213 10-02-200
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
1
by: anonymous | last post by:
I've been trying to put a them, please help me out. Here's the major parts of my code: public Form1() { DataSet myDataSet = new DataSet("myDataSet"); DataTable testTable = new...
1
by: MrNobody | last post by:
I seem to be having trouble trying to select the right value in a ComboBox DataSourced by a DataTable with a value for a DataRow... For example... In a Windows Form, I have a ComboBox: ...
2
by: MrNobody | last post by:
If I DataSource a ComboBox to a DataTable, and specify a column for ValueMember and DisplayMember, everything comes out fine until I sort. When I sort, it seems to sort the DisplayMembers...
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
2
by: Don | last post by:
I've looked high and low for some code that will allow me to have a combobox with a flat borderstyle. I found a few examples, but nothing that was really usable for me. I had the following...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.