Better way to check for data in dataGridView?

T

trint

I am writing a similar program that I have written as a WebForm, only
this is a WinForm.
In the WebForm I check for a row count in a GridView. It works
perfectly everytime when
GridView1.Row.Count == 0.
But, in my WinForm, this code:

bindingSource4.DataSource = GetData2("Select id, parent_id, name,
image_file_name, thumbnail FROM categories where parent_id = '" +
dgData1 + "' order by sort_order asc");
dataGridView6.DataSource = bindingSource4;
if (dataGridView6.RowCount == 0)
{

shows a 1 for One Row when there is NO data.

Can I check for data in another way for a dataGridView than Row.Count
or RowCount?
Any help is appreciated.
Thanks,
Trint
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top