Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
Questionhowto use datagridview footer ? help ??? Pin
cmpeng348-Jun-06 1:01
cmpeng348-Jun-06 1:01 
AnswerRe: howto use datagridview footer ? help ??? Pin
leckey8-Jun-06 5:32
leckey8-Jun-06 5:32 
Questiona question about relational database with c# ? [modified] Pin
cmpeng348-Jun-06 0:52
cmpeng348-Jun-06 0:52 
AnswerRe: a question about relational database with c# ? [modified] Pin
Stephan Samuel8-Jun-06 0:55
Stephan Samuel8-Jun-06 0:55 
AnswerRe: a question about relational database with c# ? [modified] Pin
alyeasad8-Jun-06 2:02
alyeasad8-Jun-06 2:02 
Questioncomparision Pin
Mahmood Ilyas8-Jun-06 0:42
Mahmood Ilyas8-Jun-06 0:42 
AnswerRe: comparision Pin
Stephan Samuel8-Jun-06 0:52
Stephan Samuel8-Jun-06 0:52 
GeneralRe: comparision Pin
Mahmood Ilyas8-Jun-06 1:23
Mahmood Ilyas8-Jun-06 1:23 
Questionsignatures of a file [modified] Pin
Gulfaraz8-Jun-06 0:38
Gulfaraz8-Jun-06 0:38 
AnswerRe: signatures of a file [modified] Pin
Paul Brower8-Jun-06 1:45
Paul Brower8-Jun-06 1:45 
QuestionConnection Error Pin
pirogramci8-Jun-06 0:28
pirogramci8-Jun-06 0:28 
AnswerRe: Connection Error Pin
Stephan Samuel8-Jun-06 0:50
Stephan Samuel8-Jun-06 0:50 
AnswerRe: Connection Error Pin
alyeasad8-Jun-06 2:05
alyeasad8-Jun-06 2:05 
AnswerRe: Connection Error Pin
alyeasad8-Jun-06 2:09
alyeasad8-Jun-06 2:09 
AnswerRe: Connection Error Pin
pirogramci8-Jun-06 3:02
pirogramci8-Jun-06 3:02 
QuestionUrgent Pin
Shiv57-Jun-06 23:39
Shiv57-Jun-06 23:39 
AnswerRe: Urgent Pin
Colin Angus Mackay8-Jun-06 0:44
Colin Angus Mackay8-Jun-06 0:44 
AnswerRe: Urgent Pin
rfjeld8-Jun-06 0:52
rfjeld8-Jun-06 0:52 
AnswerRe: Urgent Pin
J4amieC8-Jun-06 1:08
J4amieC8-Jun-06 1:08 
GeneralRe: Urgent Pin
BoneSoft8-Jun-06 4:54
BoneSoft8-Jun-06 4:54 
JokeRe: Urgent Pin
Koushik Biswas8-Jun-06 8:16
Koushik Biswas8-Jun-06 8:16 
QuestionSetting default document in IIS 6.0 from commandline [modified] Pin
BhaskarJha7-Jun-06 23:30
BhaskarJha7-Jun-06 23:30 
QuestionListBox [modified] Pin
Nafiseh Salmani7-Jun-06 22:58
Nafiseh Salmani7-Jun-06 22:58 
AnswerRe: ListBox [modified] Pin
rfjeld7-Jun-06 23:23
rfjeld7-Jun-06 23:23 
QuestionProblem in getting value from Un-bounded DataGridViw. Pin
Mairaaj Khan7-Jun-06 22:13
professionalMairaaj Khan7-Jun-06 22:13 
Hi,
Need Help Please!

Appearing Error Message: "Object reference not set to an instance of an object", while pointing to dgvInventoryItems.
Problem 1)
Despite of Checks, this message come when i click on the empty (last) row of the DataGridView which is binded with the DataTable.
if (this.dgvInventoryItems.CurrentRow != null )<br />
//if (this.dgvInventoryItems.CurrentRow.Cells[0].Value != null )<br />
{<br />
this.tbItemNrEdit.Text = this.dgvInventoryItems.Rows[index].Cells["ItemNr"].Value.ToString();<br />
....... }


Problem 2)
The same message again appear when trying to get value from the cell of a non-binded DataGridView. This time it has a string value, but again its generating the above mentioned error message.
Trying to get value from the cell in CellLeave event of the grid.
here is the code.

private void dgvNewInventory_CellLeave(object sender, DataGridViewCellEventArgs e)<br />
{<br />
long id=333; string strval;<br />
strval = this.dgvNewInventory.Rows[e.RowIndex].Cells[0].Value.ToString(); //PROBLEM IS IN THIS LINE<br />
dgvNewInventory.Rows[e.RowIndex].Cells[1].Value = id; // IT WORKS PEFECTLY<br />
}


Where i'm making mistak.

Thanks.

_____________________________
Success is not something to wait for, its something to work for.

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.