Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Not getting the value of Data grid view's check box status
Mamta Jain
Dec 15 2016 2:01 AM
201
Reply
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;
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Multi-Page Winform and Custom UserControl
How do I make notifyIcon stay in the system tray?