Click here to Skip to main content
15,907,395 members
Home / Discussions / C#
   

C#

 
GeneralRe: @^@ how to handle a pointer returned by a COM interface Pin
dragooooon lee28-Mar-06 16:17
dragooooon lee28-Mar-06 16:17 
GeneralRe: @^@ how to handle a pointer returned by a COM interface Pin
dragooooon lee28-Mar-06 16:20
dragooooon lee28-Mar-06 16:20 
QuestionSetting Application Args when creating AppDomain Pin
Tristan Rhodes26-Mar-06 12:03
Tristan Rhodes26-Mar-06 12:03 
QuestionWindows Versions Pin
Tyrus18226-Mar-06 11:34
Tyrus18226-Mar-06 11:34 
AnswerRe: Windows Versions Pin
Steve Pullan26-Mar-06 11:52
Steve Pullan26-Mar-06 11:52 
QuestionDisconnect from Sql Server Pin
Mark0626-Mar-06 9:42
Mark0626-Mar-06 9:42 
AnswerRe: Disconnect from Sql Server Pin
Guffa26-Mar-06 9:50
Guffa26-Mar-06 9:50 
QuestionAccess GridViewCell Columns by string Key Pin
Monin D.26-Mar-06 9:32
Monin D.26-Mar-06 9:32 
I have a DataGridView dataGridView1.
DataGridViewTextBoxColumn nCol;

nCol = new DataGridViewTextBoxColumn();
nCol.Name = "col1";
dataGridView1.Columns.Add(nCol);

nCol = new DataGridViewTextBoxColumn();
nCol.Name = "col2";
dataGridView1.Columns.Add(nCol);


And I want to add a row to it when I click a button so:
DataGridViewRow tempRow = new DataGridViewRow();
tempRow.CreateCells(dataGridView1);
tempRow.Cells["col1"].Value = "test1";
tempRow.Cells["col2"].Value = "test2";
dataGridView1.Rows.Add(tempRow);

But it returns error:
Column named col1 cannot be found.
Parameter name: columnName

When I access it by numeric index all ok. But when by Column name it returns this error. Where are I am wrong?

-- modified at 15:33 Sunday 26th March, 2006
QuestionDebugging Windows Service Pin
Mircea Grelus26-Mar-06 9:13
Mircea Grelus26-Mar-06 9:13 
AnswerRe: Debugging Windows Service Pin
Luis Alonso Ramos26-Mar-06 17:08
Luis Alonso Ramos26-Mar-06 17:08 
GeneralRe: Debugging Windows Service Pin
Mircea Grelus28-Mar-06 8:10
Mircea Grelus28-Mar-06 8:10 
QuestionChecking DB existance Pin
Mridang Agarwalla26-Mar-06 8:38
Mridang Agarwalla26-Mar-06 8:38 
AnswerRe: Checking DB existance Pin
Colin Angus Mackay26-Mar-06 10:49
Colin Angus Mackay26-Mar-06 10:49 
QuestionDeploying and Loading an assembly Pin
Subby Dev26-Mar-06 8:00
Subby Dev26-Mar-06 8:00 
QuestionFlateStyle.System Button Pin
Gamil Mohamad26-Mar-06 6:17
Gamil Mohamad26-Mar-06 6:17 
AnswerRe: FlateStyle.System Button Pin
AB777126-Mar-06 17:09
AB777126-Mar-06 17:09 
GeneralRe: FlateStyle.System Button Pin
Gamil Mohamad26-Mar-06 20:13
Gamil Mohamad26-Mar-06 20:13 
Questionlooking for program that chake similry code Pin
The_general1026-Mar-06 5:40
The_general1026-Mar-06 5:40 
QuestionHow to carry out MoneyCell with the VS2005 and GDI+? Pin
Chinese_ynzy26-Mar-06 5:24
Chinese_ynzy26-Mar-06 5:24 
QuestionInterface Type-casting problem Pin
hhrafn26-Mar-06 4:18
hhrafn26-Mar-06 4:18 
GeneralRe: Interface Type-casting problem Pin
Guffa26-Mar-06 4:27
Guffa26-Mar-06 4:27 
GeneralRe: Interface Type-casting problem Pin
hhrafn26-Mar-06 5:56
hhrafn26-Mar-06 5:56 
Questionerror handling in C# Pin
Mridang Agarwalla26-Mar-06 4:13
Mridang Agarwalla26-Mar-06 4:13 
AnswerRe: error handling in C# Pin
Guffa26-Mar-06 4:22
Guffa26-Mar-06 4:22 
GeneralRe: error handling in C# Pin
Mridang Agarwalla26-Mar-06 4:35
Mridang Agarwalla26-Mar-06 4:35 

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.