Click here to Skip to main content
15,912,977 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Try Your Luck Pin
Christian Graus11-Sep-07 7:28
protectorChristian Graus11-Sep-07 7:28 
GeneralRe: Try Your Luck Pin
Karma3125111-Sep-07 7:38
Karma3125111-Sep-07 7:38 
GeneralRe: Try Your Luck Pin
Christian Graus11-Sep-07 8:42
protectorChristian Graus11-Sep-07 8:42 
GeneralRe: Try Your Luck Pin
Dave Kreskowiak11-Sep-07 13:10
mveDave Kreskowiak11-Sep-07 13:10 
QuestionDBNull error w/checkbox in datagrid Pin
ggreekggod11-Sep-07 7:00
ggreekggod11-Sep-07 7:00 
AnswerRe: DBNull error w/checkbox in datagrid Pin
Johan Hakkesteegt13-Sep-07 1:36
Johan Hakkesteegt13-Sep-07 1:36 
GeneralRe: DBNull error w/checkbox in datagrid Pin
ggreekggod13-Sep-07 4:54
ggreekggod13-Sep-07 4:54 
GeneralRe: DBNull error w/checkbox in datagrid Pin
Johan Hakkesteegt14-Sep-07 2:36
Johan Hakkesteegt14-Sep-07 2:36 
You can just add a IsDBNull check before you assign checkCell:
Private Sub grdSelect_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grdSelect.CellValueChanged<br />
If Not mtfLoading Then<br />
If IsDBNull(grdSelect.Rows(e.RowIndex).Cells("Select")) Then<br />
checkCell = False 'or True, your choice<br />
else<br />
checkCell = CType(grdSelect.Rows(e.RowIndex).Cells("Select"), DataGridViewCheckBoxCell)<br />
End If<br />
If checkCell.Value = True Then<br />
Call EnableObjects(True)<br />
Else<br />
Call EnableObjects(False)<br />
End If<br />
End If<br />
End Sub


By the way, you could write this same code more efficiently like so:
Private Sub grdSelect_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grdSelect.CellValueChanged<br />
If Not mtfLoading Then<br />
If IsDBNull(grdSelect.Rows(e.RowIndex).Cells("Select")) Then<br />
Call EnableObjects(False) 'Or True, your choice<br />
'Or just do nothing, and simply wait for this event to be triggered again.<br />
else<br />
Call EnableObjects(CType(grdSelect.Rows(e.RowIndex).Cells("Select"), DataGridViewCheckBoxCell))<br />
End If<br />
End If<br />
End Sub


Hope this helps,

Johan

My advice is free, and you may get what you paid for.

GeneralRe: DBNull error w/checkbox in datagrid Pin
ggreekggod17-Sep-07 4:24
ggreekggod17-Sep-07 4:24 
Questionvb6 How do I get a Form UnLoad to wait until a Function call is completed? Pin
Robert from Florida11-Sep-07 6:28
Robert from Florida11-Sep-07 6:28 
AnswerRe: vb6 How do I get a Form UnLoad to wait until a Function call is completed? Pin
Dave Kreskowiak11-Sep-07 13:08
mveDave Kreskowiak11-Sep-07 13:08 
AnswerRe: vb6 How do I get a Form UnLoad to wait until a Function call is completed? Pin
MohammadAmiry11-Sep-07 21:58
MohammadAmiry11-Sep-07 21:58 
GeneralRe: vb6 How do I get a Form UnLoad to wait until a Function call is completed? Pin
Dave Kreskowiak12-Sep-07 3:30
mveDave Kreskowiak12-Sep-07 3:30 
GeneralRe: vb6 How do I get a Form UnLoad to wait until a Function call is completed? Pin
Robert from Florida13-Sep-07 5:39
Robert from Florida13-Sep-07 5:39 
GeneralRe: vb6 How do I get a Form UnLoad to wait until a Function call is completed? Pin
Dave Kreskowiak13-Sep-07 12:33
mveDave Kreskowiak13-Sep-07 12:33 
QuestionCall crystall report form VB 6.0 [modified] Pin
Tomic11-Sep-07 4:39
Tomic11-Sep-07 4:39 
Questionreference Pin
samerh11-Sep-07 4:07
samerh11-Sep-07 4:07 
AnswerRe: reference Pin
Tom Deketelaere11-Sep-07 4:36
professionalTom Deketelaere11-Sep-07 4:36 
GeneralRe: reference Pin
samerh11-Sep-07 18:51
samerh11-Sep-07 18:51 
GeneralRe: reference Pin
Dave Kreskowiak12-Sep-07 3:25
mveDave Kreskowiak12-Sep-07 3:25 
QuestionDeployment Problem Pin
manuo511-Sep-07 3:26
manuo511-Sep-07 3:26 
AnswerRe: Deployment Problem Pin
Vimalsoft(Pty) Ltd11-Sep-07 3:44
professionalVimalsoft(Pty) Ltd11-Sep-07 3:44 
GeneralRe: Deployment Problem Pin
GuyThiebaut11-Sep-07 4:22
professionalGuyThiebaut11-Sep-07 4:22 
AnswerRe: Deployment Problem Pin
GuyThiebaut11-Sep-07 3:47
professionalGuyThiebaut11-Sep-07 3:47 
Questionasp.net update,delete qustion Pin
Oracle Friend11-Sep-07 3:09
Oracle Friend11-Sep-07 3:09 

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.