Click here to Skip to main content
15,881,898 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to activate event procedure Pin
D Shen26-Sep-02 3:50
D Shen26-Sep-02 3:50 
GeneralRe: How to activate event procedure Pin
D Shen26-Sep-02 4:15
D Shen26-Sep-02 4:15 
GeneralRe: How to activate event procedure Pin
D Shen26-Sep-02 4:26
D Shen26-Sep-02 4:26 
GeneralRe: How to activate event procedure Pin
leppie26-Sep-02 7:17
leppie26-Sep-02 7:17 
GeneralRe: How to activate event procedure Pin
leppie25-Sep-02 12:08
leppie25-Sep-02 12:08 
Questionmultiple search patterns with Directory.GetFiles? Pin
Wjousts25-Sep-02 9:41
Wjousts25-Sep-02 9:41 
AnswerRe: multiple search patterns with Directory.GetFiles? Pin
Paul Riley25-Sep-02 10:29
Paul Riley25-Sep-02 10:29 
GeneralHere is a tough one - DataGrid throwing exception while repainting Pin
Luis Alonso Ramos25-Sep-02 7:25
Luis Alonso Ramos25-Sep-02 7:25 
I have this code in my Clear() routine:

ds.Tables[0].Rows.Clear();
grdProducts.Refresh();


ds is an in-memory DataSet, not associated with any database, a simple way to access what's in the DataGrid. grdProducts if of course a DataGrid.

The problem is that most of the times I run this code there's an unhandled NullReferenceException exception ("Object reference not set to an instance of an object").

Looking at the stack trace, it happens when the DataGrid is painting itself (after a WndPaint event). If I omit the grdProducts.Refresh() call in my code, I don't see any of my functions in the stack trace, but adding it makes the function in progress appear several levels down the trace (obvious).

Any ideas??

-- LuisR


──────────────
  Luis Alonso Ramos
  Chihuahua, Mexico
  www.luisalonsoramos.com

"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
GeneralRe: Here is a tough one - DataGrid throwing exception while repainting Pin
leppie25-Sep-02 7:45
leppie25-Sep-02 7:45 
GeneralRe: Here is a tough one - DataGrid throwing exception while repainting Pin
Luis Alonso Ramos25-Sep-02 9:05
Luis Alonso Ramos25-Sep-02 9:05 
GeneralRe: Here is a tough one - DataGrid throwing exception while repainting Pin
leppie25-Sep-02 9:20
leppie25-Sep-02 9:20 
GeneralRe: Here is a tough one - DataGrid throwing exception while repainting Pin
Luis Alonso Ramos26-Sep-02 5:31
Luis Alonso Ramos26-Sep-02 5:31 
GeneralOpenFileDialog slowing me down?! Pin
Zombies with Coffee, LLC25-Sep-02 6:41
professionalZombies with Coffee, LLC25-Sep-02 6:41 
GeneralRe: Slow function calls when no breakpoint set?! Pin
leppie25-Sep-02 7:03
leppie25-Sep-02 7:03 
GeneralRe: Slow function calls when no breakpoint set?! Pin
Zombies with Coffee, LLC25-Sep-02 8:14
professionalZombies with Coffee, LLC25-Sep-02 8:14 
GeneralRe: Slow function calls when no breakpoint set?! Pin
Zombies with Coffee, LLC25-Sep-02 8:34
professionalZombies with Coffee, LLC25-Sep-02 8:34 
GeneralRe: Slow function calls when no breakpoint set?! Pin
Zombies with Coffee, LLC25-Sep-02 9:09
professionalZombies with Coffee, LLC25-Sep-02 9:09 
GeneralRe: Slow function calls when no breakpoint set?! Pin
leppie25-Sep-02 9:31
leppie25-Sep-02 9:31 
GeneralRe: Slow function calls when no breakpoint set?! Pin
Zombies with Coffee, LLC25-Sep-02 9:40
professionalZombies with Coffee, LLC25-Sep-02 9:40 
GeneralRe: Slow function calls when no breakpoint set?! Pin
Zombies with Coffee, LLC25-Sep-02 9:58
professionalZombies with Coffee, LLC25-Sep-02 9:58 
GeneralRe: Slow function calls when no breakpoint set?! Pin
leppie25-Sep-02 10:16
leppie25-Sep-02 10:16 
GeneralRe: Slow function calls when no breakpoint set?! Pin
Zombies with Coffee, LLC25-Sep-02 10:24
professionalZombies with Coffee, LLC25-Sep-02 10:24 
GeneralRe: Slow function calls when no breakpoint set?! Pin
Zombies with Coffee, LLC25-Sep-02 11:09
professionalZombies with Coffee, LLC25-Sep-02 11:09 
GeneralRe: Slow function calls when no breakpoint set?! Pin
leppie26-Sep-02 7:22
leppie26-Sep-02 7:22 
QuestionHow to accessing profile settings? Pin
CherezZaboro25-Sep-02 6:26
CherezZaboro25-Sep-02 6:26 

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.