Click here to Skip to main content
15,923,281 members
Home / Discussions / C#
   

C#

 
GeneralRe: Exiting app in Catch Pin
Stefan Troschuetz11-Aug-06 20:40
Stefan Troschuetz11-Aug-06 20:40 
GeneralRe: Exiting app in Catch Pin
Stick^11-Aug-06 23:26
Stick^11-Aug-06 23:26 
AnswerRe: Exiting app in Catch Pin
Glen Harvy11-Aug-06 10:54
Glen Harvy11-Aug-06 10:54 
GeneralRe: Exiting app in Catch Pin
Stick^11-Aug-06 10:59
Stick^11-Aug-06 10:59 
GeneralWrong forum by accident...please ignore! Pin
leckey11-Aug-06 9:51
leckey11-Aug-06 9:51 
AnswerRe: Null reference object error/enumeration problem Pin
Judah Gabriel Himango11-Aug-06 10:00
sponsorJudah Gabriel Himango11-Aug-06 10:00 
GeneralRe: Null reference object error/enumeration problem Pin
leckey11-Aug-06 11:46
leckey11-Aug-06 11:46 
GeneralDatagridViewComboCell Issues. Pin
ssp2011-Aug-06 9:49
ssp2011-Aug-06 9:49 
Hello,

I am trying to create columns in a datagridview which will have couple of textcolumns and one ComboColumn.
I am trying to add a class to the combo column. This class contains an ID column and a description column. When the user selects the item in combo column i want to extract the ID from the selected object.
But after populating the grid with my class, and selecting the dropdown, I am getting an error
"System.ArgumentException: DataGridViewComboCell value is not valid".
I have no code written in any of the events in the grid.

Any help is highly appreciated.

Here is my code snippet

datagridview1.ColumnCount = 2;

DataGridViewComboBoxCell dgvCell=new DataGridViewComboBoxCell();

//clsCombo is my class which has a constructor ID and Description
clsCombo objCombo = new clsCombo("1", "Male");
dgvCell.Items.Add(objCombo);

objCombo.ID = "2";
objCombo.Description = "Female";
dgvCell.Items.Add(objCombo);

objCombo.ID = "3";
objCombo.Description = "Other";
dgvCell.Items.Add(objCombo);

DataGridViewRow dgvRow = new DataGridViewRow();
dgvRow.Cells.Add(dgvCell);

datagridview1.Rows.Add(dgvRow);

Thanks
Siva
QuestionInterop.Excel x the memory could not be read Pin
ARLUNSQUI11-Aug-06 8:53
ARLUNSQUI11-Aug-06 8:53 
QuestionHow can a control always be on top Pin
sas949111-Aug-06 7:57
sas949111-Aug-06 7:57 
AnswerRe: How can a control always be on top Pin
Ryomin11-Aug-06 8:25
professionalRyomin11-Aug-06 8:25 
GeneralRe: How can a control always be on top Pin
sas949111-Aug-06 9:14
sas949111-Aug-06 9:14 
GeneralRe: How can a control always be on top [modified] Pin
Ryomin11-Aug-06 9:20
professionalRyomin11-Aug-06 9:20 
GeneralRe: How can a control always be on top Pin
sas949111-Aug-06 9:27
sas949111-Aug-06 9:27 
GeneralRe: How can a control always be on top Pin
Ennis Ray Lynch, Jr.11-Aug-06 9:41
Ennis Ray Lynch, Jr.11-Aug-06 9:41 
Questionaccess database on a server via a windows application? Pin
keroed_edmond11-Aug-06 4:20
keroed_edmond11-Aug-06 4:20 
AnswerRe: access database on a server via a windows application? Pin
Not Active11-Aug-06 4:32
mentorNot Active11-Aug-06 4:32 
GeneralRe: access database on a server via a windows application? Pin
Guffa11-Aug-06 8:06
Guffa11-Aug-06 8:06 
GeneralRe: access database on a server via a windows application? Pin
Not Active11-Aug-06 8:30
mentorNot Active11-Aug-06 8:30 
GeneralRe: access database on a server via a windows application? Pin
Guffa11-Aug-06 9:48
Guffa11-Aug-06 9:48 
AnswerRe: access database on a server via a windows application? Pin
Paul Conrad11-Aug-06 4:53
professionalPaul Conrad11-Aug-06 4:53 
GeneralRe: access database on a server via a windows application? Pin
Guffa11-Aug-06 8:11
Guffa11-Aug-06 8:11 
GeneralRe: access database on a server via a windows application? Pin
Rob Graham11-Aug-06 8:46
Rob Graham11-Aug-06 8:46 
General Re: access database on a server via a windows application? Pin
Paul Conrad11-Aug-06 15:34
professionalPaul Conrad11-Aug-06 15:34 
AnswerRe: access database on a server via a windows application? Pin
Guffa11-Aug-06 8:04
Guffa11-Aug-06 8:04 

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.