TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mamta Jain
NA
417
14.4k
Not getting the value of Data grid view's check box status
Dec 15 2016 2:01 AM
I have a grid view in which 3 columns have been added of check boxes .
but when I check the value as it check box is check or unchecked its every time gives false value .
My question is how can i get the state of checkboxes .
My code :
public string user_rights()
{
string msg = "";
int add = 0;
int delete = 0 ;
int view = 0 ;
foreach (DataGridViewRow dgvr1 in DGV.Rows)
{
if (dgvr1.Cells[0].Value.ToString() == "True")
{
add = add + 1;
}
if (dgvr1.Cells[1].Value.ToString() == "True")
{
delete = delete + 1;
}
if (dgvr1.Cells[2].Value.ToString() == "True")
{
view = view + 1;
}
}
if(add == 0 && delete == 0 && view == 0 )
{
msg = "Select atleast one user rights" ;
}
return msg;
}
Reply
Answers (
1
)
Multi-Page Winform and Custom UserControl
How do I make notifyIcon stay in the system tray?