Click here to Skip to main content
15,888,263 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to Pass the Value of Object Pin
Ravi Sant26-Apr-11 4:18
Ravi Sant26-Apr-11 4:18 
GeneralRe: How to Pass the Value of Object Pin
PIEBALDconsult26-Apr-11 2:48
mvePIEBALDconsult26-Apr-11 2:48 
GeneralRe: How to Pass the Value of Object Pin
Ravi Sant26-Apr-11 4:18
Ravi Sant26-Apr-11 4:18 
AnswerRe: How to Pass the Value of Object Pin
Shameel26-Apr-11 1:56
professionalShameel26-Apr-11 1:56 
AnswerRe: How to Pass the Value of Object Pin
PIEBALDconsult26-Apr-11 2:49
mvePIEBALDconsult26-Apr-11 2:49 
AnswerRe: How to Pass the Value of Object Pin
Ravi Sant26-Apr-11 4:33
Ravi Sant26-Apr-11 4:33 
AnswerRe: How to Pass the Value of Object Pin
Sanjay J Patolia27-Apr-11 16:09
Sanjay J Patolia27-Apr-11 16:09 
Questionshowing newly added row in datagridview - Winforms Pin
manumith25-Apr-11 10:09
manumith25-Apr-11 10:09 
I have a datagridview in a winform application, that gets data from an external dll and displays it dynamically.
As the new rows are getting added I want to show the newly added row to the user (so that the old rows keep moving upwards).
I am adding the new rows and showing the last added row as follows
string[] currentRow = new string[5];
currentRow[0] = curr.sequence().ToString();
currentRow[1] = typeString;
currentRow[2] = curr.stat().ToString();
currentRow[3] = detail;
currentRow[4] = curr.timestamp().ToString();

this.dataGridView1.Rows.Add(currentRow);
this.labelCount.Text = curr.sequence().ToString();
dataGridView1.CurrentCell = dataGridView1.Rows[curr.sequence()-1].Cells[0]; //exception occurs here


I am getting an exception of
[System.ArgumentOutOfRangeException] = {"Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"}

at the line where I set the CurrentCell.
Although it occurly at random rows everytime. Sometime it occurs as early as 25th row. Other times at 1000th row.
What could be causing it? I see that the sequence is displayed correctly at labelbox.
Please help.

Thanks in advance.
AnswerRe: showing newly added row in datagridview - Winforms Pin
Not Active25-Apr-11 10:40
mentorNot Active25-Apr-11 10:40 
GeneralRe: showing newly added row in datagridview - Winforms Pin
manumith25-Apr-11 10:43
manumith25-Apr-11 10:43 
GeneralRe: showing newly added row in datagridview - Winforms Pin
Not Active25-Apr-11 11:49
mentorNot Active25-Apr-11 11:49 
GeneralRe: showing newly added row in datagridview - Winforms Pin
manumith25-Apr-11 13:04
manumith25-Apr-11 13:04 
GeneralRe: showing newly added row in datagridview - Winforms Pin
Richard MacCutchan25-Apr-11 22:08
mveRichard MacCutchan25-Apr-11 22:08 
GeneralRe: showing newly added row in datagridview - Winforms Pin
Pete O'Hanlon25-Apr-11 22:38
mvePete O'Hanlon25-Apr-11 22:38 
AnswerRe: showing newly added row in datagridview - Winforms Pin
Luc Pattyn25-Apr-11 11:11
sitebuilderLuc Pattyn25-Apr-11 11:11 
Question.NET Collections - Capacity [modified] Pin
devvvy25-Apr-11 1:03
devvvy25-Apr-11 1:03 
AnswerRe: .NET Collections - Capacity Pin
Luc Pattyn25-Apr-11 1:17
sitebuilderLuc Pattyn25-Apr-11 1:17 
GeneralRe: .NET Collections - Capacity Pin
devvvy25-Apr-11 1:27
devvvy25-Apr-11 1:27 
GeneralRe: .NET Collections - Capacity Pin
Luc Pattyn25-Apr-11 1:33
sitebuilderLuc Pattyn25-Apr-11 1:33 
GeneralRe: .NET Collections - Capacity Pin
devvvy25-Apr-11 1:37
devvvy25-Apr-11 1:37 
GeneralRe: .NET Collections - Capacity [modified] Pin
devvvy25-Apr-11 1:52
devvvy25-Apr-11 1:52 
GeneralRe: .NET Collections - Capacity Pin
AspDotNetDev25-Apr-11 11:05
protectorAspDotNetDev25-Apr-11 11:05 
GeneralRe: .NET Collections - Capacity Pin
Jason Christian26-Apr-11 8:13
Jason Christian26-Apr-11 8:13 
AnswerRe: .NET Collections - Capacity Pin
AspDotNetDev25-Apr-11 11:10
protectorAspDotNetDev25-Apr-11 11:10 
GeneralRe: .NET Collections - Capacity Pin
Charvak Karpe28-Apr-11 3:47
Charvak Karpe28-Apr-11 3:47 

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.