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

VS2003: Issue with Bound, Sorted ComboBox

Hello All,

I seem to have found a problem using a ComboBox. If you bind a ComboBox to
an ArrayList of classes, setting the DisplayMember to one field in the class
and the ValueMember to another, and the ComboBox is sorted, then the bounded
indices are incorrect.

It appears that the ComboBox is sorted on ValueMember, but the associated
DisplayMember does not come along for the ride.

pagates

Nov 17 '05 #1
1 1399
pagates wrote:
Hello All,

I seem to have found a problem using a ComboBox. If you bind a
ComboBox to an ArrayList of classes, setting the DisplayMember to one
field in the class and the ValueMember to another, and the ComboBox
is sorted, then the bounded indices are incorrect.

It appears that the ComboBox is sorted on ValueMember, but the
associated DisplayMember does not come along for the ride.


Correct, I ran into this issue some time ago as well. I sorted the
arraylist with its Sort() method first, then bound it to the combobox
and not set the combobox as sorted.

FB

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 17 '05 #2

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

Similar topics

10
by: DFS | last post by:
I'm sure this has been discussed before, but I'm too tired to hunt for it. I have a survey table containing questions with different answer scales. Some are 1 to 5, others are A,B,C, etc. I show...
5
by: Aaron Ackerman | last post by:
I have a bound combobox the appears on a cell within the column of my bound grid when the user clicks on a cell n(In my vb.net WinForm app). I am trying to allow the adding of an item to that bound...
1
by: Bob | last post by:
If the SORTED property of the ComboBox is set to TRUE it sorts the DisplayMember values, but not the ValueMember values. This gives incorrect SelectedValues.
0
by: Frnak McKenney | last post by:
Can I use a bound ComboBox for both browsing and editing? I'm working on a small, standalone database application using Visual C#.NET 2003 and an Access data file. In order to keep the number...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.