0

Hey all can you please help me to display the number of records in a datagridview in a combobox

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by nmaillet
0

You could handle the RowsAdded and RowsRemoved events, then implement something like this:

private void dataGridView_RowsAdded(object sender, DataGridViewRowsAddedEventArgs args)
{
    textBox.Text = ((DataGridView)sender).Rows.Count;
}

private void dataGridView_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs args)
{
    textBox.Text = ((DataGridView)sender).Rows.Count;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.