dataGridView.Rows.Count and datagridview.RowCount

S

SePp

Hello all,

I want to display the number of items in an datagridview. I use this
one datagridview for different datasets.


The datagridview.Rowcount works fine for the most of the dataset. But
there is one dataset which has more items
than the others and the Rowcount wont work. The result is all the time
0, but it should be something like 85.

// Datsource
this.dataGridView1.DataSource = this.REMINDERBindingSource;
this.v_REMINDERTableAdapter.Fill(this.subnr.REMINDER);

// Display number of items
lbl_row.Text = dataGridView1.RowCount.ToString();
MessageBox.Show(this, dataGridView1.Rows.Count.ToString());

Has somebody an Idea? Thanks in advance.

Greets
SePp
 
S

SePp

Hello all,

I want to display the number of items in an datagridview. I use this
one datagridview for different datasets.

The datagridview.Rowcount works fine for the most of the dataset. But
there is one dataset which has more items
than the others and the Rowcount wont work. The result is all the time
0, but it should be something like 85.

// Datsource
this.dataGridView1.DataSource = this.REMINDERBindingSource;
this.v_REMINDERTableAdapter.Fill(this.subnr.REMINDER);

// Display number of items
lbl_row.Text = dataGridView1.RowCount.ToString();
MessageBox.Show(this, dataGridView1.Rows.Count.ToString());

Has somebody an Idea?  Thanks in advance.

Greets
SePp

I have a solution....

I don't use the count for the datagridview I use the Dataset instead:

MessageBox.Show(this, this.dataset_name.Rows.Count.ToString());

Thanks
 

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