The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Sorting a Data-Bound ComboBox

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Richard Jonas

Posts: 147
Nickname: rjonas
Registered: Nov, 2005

Richard Jonas is a .NET sofware developer living in the UK.
Sorting a Data-Bound ComboBox Posted: Jul 12, 2006 8:20 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Richard Jonas.
Original Post: Sorting a Data-Bound ComboBox
Feed Title: Richard Jonas
Feed URL: http://feeds.feedburner.com/blogspot/ouNA
Feed Description: Richard Jonas's blog about .NET, web development and agile methodologies.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Richard Jonas
Latest Posts From Richard Jonas

Advertisement
I have set up a view with an order by clause and bound it to a ComboBox using ADO.NET 2.0. The combo box did not take any notice of the order by clause, and seemed to display items in the order they appeared in the database tables that made up the view.

To fix this, I had to manually set the Sort property of the column I wanted the combo box to be ordered by on the BindingSource used by the control as follows before calling the Fill method on the table adapter :-


myViewBindingSource.Sort = "ID";
myViewTableAdapter.Fill(myDataSet.myView);


Why can't it pick up the order by clause in my view automatically?

Read: Sorting a Data-Bound ComboBox

Topic: Setting up Log4Net Previous Topic   Next Topic Topic: Umbau abgeschlossen. Was ist neu?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use