PC Review


Reply
Thread Tools Rate Thread

Datagrid Combobox question

 
 
Mel Parkes
Guest
Posts: n/a
 
      14th Aug 2003
I have a winforms datagrid that has several columns. Three
of the columns are displaying combo boxes. When the user
selects a value in the 1st combo, I would like to have the
data displaying in the other combos filter based upon the
selected value. Does anyone have suggestions for how to
re-apply a data source for a combo box in a datagrid after
the columnstyles have already been added?


 
Reply With Quote
 
 
 
 
Ying-Shen Yu
Guest
Posts: n/a
 
      14th Aug 2003
Hello Mel,
You asked a good question, filtering the values in combo box by the other
values in the data grid is really a good idea.
First, let me repeat my understanding on your issue, you have a data
grid, and have written your own combo box column style, what you want is
when user changes certain one of them, the rest of the combo boxes should
only have the values related to that new value, am I right?
Ok, I think you have two ways to implement this feature; you may use
either of them.
The first solution is derive a class from your ComboBoxColumnStyle and
override the method SetColumnValueAtRow, you can get the rest column styles
via it's property
DataGridTableStyle.GridColumnStyles, then you may do as you wish. Use this
type in the column which you want to AWARE other columns.
The second solution is similar; you can derive a class from
ComboBoxColumnStyle, and override the Edit method. Then you can use this
type in columns which you want to be AWARED.
As you can see, the first solution is suitable for the case that one
value can determine several other values, and the second solution is more
suitable for the case that one value should be determined by several values.

I hope these solutions can help you resolve your problem, if you have any
updates on this issue, please let me know, thanks!


Kind regards,

Ying-Shen Yu [MSFT]
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.
--------------------
| Content-Class: urn:content-classes:message
| From: "Mel Parkes" <(E-Mail Removed)>
| Sender: "Mel Parkes" <(E-Mail Removed)>
| Subject: Datagrid Combobox question
| Date: Wed, 13 Aug 2003 17:23:04 -0700
| Lines: 9
| Message-ID: <11f901c361fa$3a3e8540$(E-Mail Removed)>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNh+jo+0GY4OwkpTyWhajiODNYdhw==
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:50230
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| I have a winforms datagrid that has several columns. Three
| of the columns are displaying combo boxes. When the user
| selects a value in the 1st combo, I would like to have the
| data displaying in the other combos filter based upon the
| selected value. Does anyone have suggestions for how to
| re-apply a data source for a combo box in a datagrid after
| the columnstyles have already been added?
|
|
|

 
Reply With Quote
 
pouya
Guest
Posts: n/a
 
      14th Aug 2003

>-----Original Message-----
>I have a winforms datagrid that has several columns.

Three
>of the columns are displaying combo boxes. When the

user
>selects a value in the 1st combo, I would like to have

the
>data displaying in the other combos filter based upon

the
>selected value. Does anyone have suggestions for how to
>re-apply a data source for a combo box in a datagrid

after
>the columnstyles have already been added?
>
>
>.
>

 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
datagrid, change combobox value at run time based on the value of another combobox at different column zhuang Microsoft Dot NET 0 1st Mar 2006 09:31 AM
datagrid, change combobox value at run time based on the value of another combobox at different column zhuang Microsoft Dot NET Framework Forms 0 23rd Feb 2006 05:04 PM
Re: datagrid combobox question Doug Bell Microsoft VB .NET 1 5th Nov 2004 12:08 PM
datagrid combobox question Doug Bell Microsoft VB .NET 6 4th Nov 2004 08:46 AM
ComboBox on DataGrid Question Ed Crowley Microsoft ADO .NET 0 22nd Sep 2003 02:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:58 AM.