PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms datagridview combo box sorting

Reply

datagridview combo box sorting

 
Thread Tools Rate Thread
Old 21-12-2007, 06:10 PM   #1
chuck rudolph
Guest
 
Posts: n/a
Default datagridview combo box sorting


It seems that a common approach would be to bind a table via a dataset to a
datagridview and then bind columns which contain codes to a combo box. The
code would be the value member; the display member of the combo box would be
a pretty name for the code and would come from another table in the dataset.
And this is easy enough to do.

The difficulty that i have is how to sort this column on the display member
value instead of the value member.

So did I miss something obvious?

My current thinking is to implement an object that also implements
IBindingList. Bind this to the datagridview and have it use the two
datatables as the backing store. In IBindingList.AppySort() this object would
be smart enough to use the display name for the column in question.

Other ideas are welcomed...Chuck
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off