Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
How to check if a selected row in a datagridview is empty(has no item)
Ari
Nov 4 2011 4:21 AM
10.2k
Reply
Hey! First time poster here, first of all I wasn't sure if this is the right place to post but, how would I accomplish this? I've been trying the following:
if (dgvClient.SelectedRows.Count > 0)
{
DataGridViewRow currentRow = dgvClient.SelectedRows[0];
if (currentRow.Cells.ToString() != String.Empty)
{
//The code that will be here will open a form
}
else
{
MessageBox.Show("Select a non null row");
}
}
However, it doesn't appear to be working, and I'm out of ideas :/
Thanks for any help,
Ari
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Change Web config Values using C#.net tool
Url bane for parrental control in window forms