dataGridView.Rows.Count and datagridview.RowCount

  • Thread starter Thread starter SePp
  • Start date Start date
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
 
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
 
Back
Top