Click here to Skip to main content
16,011,374 members
Home / Discussions / C#
   

C#

 
GeneralRe: Class properties - how to change values from form Pin
peropata10-Mar-10 11:46
peropata10-Mar-10 11:46 
GeneralRe: Class properties - how to change values from form Pin
Dan Mos10-Mar-10 12:10
Dan Mos10-Mar-10 12:10 
GeneralRe: Class properties - how to change values from form Pin
peropata10-Mar-10 19:54
peropata10-Mar-10 19:54 
QuestionC# dataset/adapter connection Pin
2010JohnFByers10-Mar-10 9:50
2010JohnFByers10-Mar-10 9:50 
AnswerRe: C# dataset/adapter connection Pin
Dan Mos10-Mar-10 10:09
Dan Mos10-Mar-10 10:09 
GeneralRe: C# dataset/adapter connection Pin
2010JohnFByers10-Mar-10 11:16
2010JohnFByers10-Mar-10 11:16 
GeneralRe: C# dataset/adapter connection Pin
Dan Mos10-Mar-10 11:30
Dan Mos10-Mar-10 11:30 
QuestionSet the SelectedItem of a populated DataGridViewComboBoxCell Pin
Member 226514810-Mar-10 7:44
Member 226514810-Mar-10 7:44 
Hi,

I have a Windows application, written in c# and in my application, I have a DataGridView that has 2 DataGridViewComboBoxColumns in it, along with a DataGridViewTextBoxColumn. The 2 ComboBoxColumns are each populated by a DataSet. For each row, the user selects an item from each of the ComboBoxColumns and enters a number into the TextBoxColumn. As an example, let's say the Color ComboBox has 3 choices in it: Red, Blue & Green and the Size ComboBox has 3 choices in it: Small, Medium & Large. In our example, for the first row, the user has selected Red from the Color ComboBox, Medium for the Size ComboBox and has entered "5" in the Qty TextBox. For Row 2, the user selected Green in that Color ComboBox, Large in the Size ComboBox and has entered "4" in the Qty TextBox.


Row...........Color(ComboBox).........Size(ComboBox)......Qty(TextBox)
----------------------------------------------------------------------------------
..1............Red...............................Medium......................5
..2............Green...........................Large.........................4

Once the user is done, this information is saved to a table. Let's also assume that this information was for January, 2010.

When the user starts a new month, (February, 2010, for example), their data could be exactly the same as January or it may change a little. If it IS the same or very close to the same, rather than force the user to reenter all of the information as they did in January, I'd like to be able to give them the option to "import" the data from January but still give them all the options that they had in January. What this means is that the Color ComboBoxColumn for each row still has Red, Blue & Green as its items that can be chosen, but for Row1, "Red" needs to be the selected item and for Row 2, "Green" needs to be the selected item. Keeping with that same idea, the Size ComboBox still has Small, Medium and Large as its items that can be selected for each row, but for Row 1, "Medium" needs to be set as the selected item and for Row 2, "Large" needs to be the selected item.

My DataGridView would be populated the exact same way as it did in January but the selected items that show would be the data that the user had chosen in January. Because I'm retrieving that data (what the user chose in Jan) from the database, I know that in the DataGridView cell for Row1, Color ComboBox, the selected item should be "Red". Since I know that, how do I set the selected item in that ComboBox to "Red"? If this was a straight ComboBox, I know how to set the SelectedItem (or SelectedIndex). But because this is a DataGridViewComboBox, it doesn't seem to work the same way.

Any ideas or suggestions will be greatly appreciated. If more information is needed in order to help me solve this, please let me know.

Thanks in advance.

Ron
QuestionCreating a list of complex object from two lists [modified] Pin
dan!sh 10-Mar-10 6:58
professional dan!sh 10-Mar-10 6:58 
AnswerRe: Creating a list of complex object from two lists Pin
masoumeh201010-Mar-10 7:16
masoumeh201010-Mar-10 7:16 
AnswerRe: Creating a list of complex object from two lists Pin
Dan Mos10-Mar-10 7:29
Dan Mos10-Mar-10 7:29 
GeneralRe: Creating a list of complex object from two lists Pin
dan!sh 10-Mar-10 7:45
professional dan!sh 10-Mar-10 7:45 
AnswerRe: Creating a list of complex object from two lists Pin
Keith Barrow10-Mar-10 9:23
professionalKeith Barrow10-Mar-10 9:23 
GeneralRe: Creating a list of complex object from two lists Pin
Dan Mos10-Mar-10 10:26
Dan Mos10-Mar-10 10:26 
GeneralRe: Creating a list of complex object from two lists Pin
dan!sh 10-Mar-10 16:56
professional dan!sh 10-Mar-10 16:56 
QuestionHow installer can call non-System account action? Pin
dims1210-Mar-10 6:03
dims1210-Mar-10 6:03 
QuestionHow to use CutePDF Writer programmatically Pin
NarVish10-Mar-10 5:53
NarVish10-Mar-10 5:53 
AnswerRe: How to use CutePDF Writer programmatically Pin
JHizzle10-Mar-10 6:01
JHizzle10-Mar-10 6:01 
QuestionHow to top Visual Studio 2005 Designer from modifying my custom control! Pin
Matthew Klein10-Mar-10 5:28
Matthew Klein10-Mar-10 5:28 
AnswerRe: How to top Visual Studio 2005 Designer from modifying my custom control! Pin
The Man from U.N.C.L.E.10-Mar-10 5:52
The Man from U.N.C.L.E.10-Mar-10 5:52 
GeneralRe: How to top Visual Studio 2005 Designer from modifying my custom control! Pin
Matthew Klein10-Mar-10 6:12
Matthew Klein10-Mar-10 6:12 
GeneralRe: How to top Visual Studio 2005 Designer from modifying my custom control! Pin
Saksida Bojan10-Mar-10 7:31
Saksida Bojan10-Mar-10 7:31 
AnswerRe: How to top Visual Studio 2005 Designer from modifying my custom control! Pin
DaveyM6910-Mar-10 6:22
professionalDaveyM6910-Mar-10 6:22 
AnswerRe: How to top Visual Studio 2005 Designer from modifying my custom control! Pin
Matthew Klein10-Mar-10 6:59
Matthew Klein10-Mar-10 6:59 
QuestionChroma key Pin
AlexB4710-Mar-10 4:56
AlexB4710-Mar-10 4:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.