Checkbox in Datagridview
Please support our VB.NET advertiser: DiscountASP.NET – 3 Months Free on VB.NET Web Hosting
Thread Solved
![]() |
•
•
Posts: 33
Reputation:
Solved Threads: 0
Hi friends
I am working in vb.net ,there is i have a form in which i have a datagridview,& a column of checkbox in tat datagridview,when this datagridview becomes load, that checkes theb employee is present or absent if present so the check box of that perticular row must be checked true else checked false,for this i did
dim chk as checkbox
if condition that
chk.checked=true
else
chk.checked=false
end if
but it giving me a error message "object refrence not set"
please help me to solve this problem
I am working in vb.net ,there is i have a form in which i have a datagridview,& a column of checkbox in tat datagridview,when this datagridview becomes load, that checkes theb employee is present or absent if present so the check box of that perticular row must be checked true else checked false,for this i did
dim chk as checkbox
if condition that
chk.checked=true
else
chk.checked=false
end if
but it giving me a error message "object refrence not set"
please help me to solve this problem
Are you adding checkboxes to datagrid at runtime?
If not, then
"object reference not set"-error comes from declaring an object
VB.NET Syntax (Toggle Plain Text)
Dim chk As New DataGridViewCheckBoxCell If condition Then chk.Value = True Else chk.Value = False End If ' Add checkbox control to datagrid DataGridView1.Item(0, 0) = chk
VB.NET Syntax (Toggle Plain Text)
If condition Then DataGridView1.Item(0, 0).Value = True Else DataGridView1.Item(0, 0).Value = False End If
dim chk as checkbox but not creating the instance, like dim chk as New checkbox Teme64 @ Windows Developer Blog
![]() |
Similar Threads
Other Threads in the VB.NET Forum
- how to trap the values of a particular row in datagridview (C#)
- Checkbox in DataGridView (VB.NET)
- Checkbox Value in DataGridView (VB.NET)
- checkbox in datagridview c# (C#)
Other Threads in the VB.NET Forum
- Previous Thread: to stop window minimization automatically
- Next Thread: Problem in deployment
•
•
•
•
Views: 1512 | Replies: 1 | Currently Viewing: 1 (0 members and 1 guests)





Linear Mode