Click here to Skip to main content
15,898,134 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: [VB10] DataGridView Columns Error Pin
The Mighty Atom14-Sep-10 12:15
The Mighty Atom14-Sep-10 12:15 
GeneralRe: [VB10] DataGridView Columns Error Pin
Luc Pattyn14-Sep-10 12:25
sitebuilderLuc Pattyn14-Sep-10 12:25 
GeneralRe: [VB10] DataGridView Columns Error Pin
The Mighty Atom14-Sep-10 12:32
The Mighty Atom14-Sep-10 12:32 
AnswerRe: [VB10] DataGridView Columns Error Pin
Luc Pattyn14-Sep-10 12:41
sitebuilderLuc Pattyn14-Sep-10 12:41 
GeneralRe: [VB10] DataGridView Columns Error [modified] Pin
The Mighty Atom14-Sep-10 12:50
The Mighty Atom14-Sep-10 12:50 
AnswerRe: [VB10] DataGridView Columns Error Pin
Luc Pattyn14-Sep-10 13:12
sitebuilderLuc Pattyn14-Sep-10 13:12 
GeneralRe: [VB10] DataGridView Columns Error Pin
The Mighty Atom14-Sep-10 13:16
The Mighty Atom14-Sep-10 13:16 
GeneralRe: [VB10] DataGridView Columns Error Pin
Luc Pattyn14-Sep-10 13:38
sitebuilderLuc Pattyn14-Sep-10 13:38 
OK, now I see; what happens is your Visual Designer code creates the RadioButton (as you designed it), and that causes the event to already fire, well before the DGV is ready to accept the data.

Solutions are many and easy.

1.
I suggest you undo the event linking (from RadioButton CheckedChanged event to its handler) in Visual Designer, and add a line of code at the end of your Form's constructor, it would be (best guess):
myRadioButton.AddHandler(CheckedChanged , Addressof myRadioButtonChangedHandler)


i.e. it should look exactly like the line Visual Designer did create for you (see one of those ....designer.vb files I mentioned earlier).

result: no event until the DGV is ready for accepting the data.

2.
Alternative: add a test at the top of your PopulateGrid method, skipping all action when not ready.
It probably would read:
if myDataGridView is Nothing Then Exit Sub


result: disturbing early event gets ignored.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: [VB10] DataGridView Columns Error Pin
The Mighty Atom14-Sep-10 13:54
The Mighty Atom14-Sep-10 13:54 
AnswerRe: [VB10] DataGridView Columns Error Pin
Luc Pattyn14-Sep-10 14:21
sitebuilderLuc Pattyn14-Sep-10 14:21 
GeneralRe: [VB10] DataGridView Columns Error Pin
The Mighty Atom15-Sep-10 7:24
The Mighty Atom15-Sep-10 7:24 
GeneralRe: [VB10] DataGridView Columns Error [modified] Pin
Luc Pattyn15-Sep-10 7:44
sitebuilderLuc Pattyn15-Sep-10 7:44 
GeneralRe: [VB10] DataGridView Columns Error Pin
The Mighty Atom15-Sep-10 12:09
The Mighty Atom15-Sep-10 12:09 
QuestionHow to add row header to DataGridView in vb.net Pin
Andraw Tang14-Sep-10 9:24
Andraw Tang14-Sep-10 9:24 
AnswerRe: How to add row header to DataGridView in vb.net Pin
Andraw Tang14-Sep-10 12:32
Andraw Tang14-Sep-10 12:32 
AnswerRe: How to add row header to DataGridView in vb.net Pin
Prerak Patel20-Sep-10 22:19
professionalPrerak Patel20-Sep-10 22:19 
Questionhow to create data grid control in VB6.0 Pin
jainiraj14-Sep-10 2:38
jainiraj14-Sep-10 2:38 
AnswerRe: how to create data grid control in VB6.0 Pin
Dave Kreskowiak14-Sep-10 4:09
mveDave Kreskowiak14-Sep-10 4:09 
Questionhow to read xml data from xml file in VB6.0 Pin
jainiraj14-Sep-10 0:19
jainiraj14-Sep-10 0:19 
AnswerRe: how to read xml data from xml file in VB6.0 Pin
Eddy Vluggen14-Sep-10 9:06
professionalEddy Vluggen14-Sep-10 9:06 
QuestionPowerPoint slide animations flicker when onscreen text updated Pin
Hypermommy13-Sep-10 9:43
Hypermommy13-Sep-10 9:43 
QuestionReferencing Variables in Module1 Pin
Win32SF12-Sep-10 9:13
Win32SF12-Sep-10 9:13 
AnswerRe: Referencing Variables in Module1 Pin
Eddy Vluggen12-Sep-10 9:59
professionalEddy Vluggen12-Sep-10 9:59 
GeneralRe: Referencing Variables in Module1 Pin
Win32SF12-Sep-10 10:11
Win32SF12-Sep-10 10:11 
GeneralRe: Referencing Variables in Module1 Pin
Eddy Vluggen12-Sep-10 10:27
professionalEddy Vluggen12-Sep-10 10:27 

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.