By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,617 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,617 IT Pros & Developers. It's quick & easy.

dataGridView.Rows.Count and datagridview.RowCount

P: n/a
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.REMIND ER);

// 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
Jan 15 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jan 15, 11:05*am, SePp <C_o_z_...@gmx.dewrote:
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.REMIND ER);

// 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

Jan 15 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.