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
mike Delvotti
NA
262
0
Remove Datagridview Rows That are Checked
Feb 12 2013 8:27 AM
I have a datagridview where the cells on one column are a checkbox item, I would like to remove (on button click) the checked rows. I think I am nearly there with the below but get the following execption thrown:
'Object cannot be cast from DBNull to other types.'
Below is the code inside the button I'm using:
for (int i = 0; i < supplyDataGridView.Rows.Count; i++)
{
if (Convert.ToBoolean(supplyDataGridView.Rows[i]
.Cells[1].Value) == true)
{
supplyDataGridView.Rows.RemoveAt(i);
}
}
Reply
Answers (
3
)
Need to Sort DataGridView from the text entered in textbox
get a combobox value from one from to other form