Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dropdown List display order changes
Message
 
À
12/08/2005 10:07:00
Patty Solomon
Central Susquehanna Intermediate Unit
Milton, Pennsylvanie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01040542
Message ID:
01041510
Vues:
20
Patty,

>My combobox's dropdown list does not display the items in the order that they exist in the DataSet's DataTable.
>
>When creating a dataset for the combo.BindingSource, a blank row is inserted at row 0 into the dataset before it is returned. Using the debugger, I've verified the row is actually inserted at row 0.
>
>However, when the form runs, the blank row appears at the bottom of the dropdown list, not at the top, as expected.
>
>Is there something happening during MMF's DataBinding process that forces the blank row to the bottom of the list?
>
>If so, is there any way to override this behavior? The desired behavior is that the blank item show at the top of the list.

There's no special code in MM .NET data binding that forces the row to be displayed at the bottom. Ultimately, behind the scenes, MM .NET uses standard Windows Forms data binding--you just don't have to write any code to data bind. By default, when you add a new row to a DataTable, it is placed at the end of the row. Have you tried binding to a sorted DataView, or are you doing that already?

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform