i want to ask about how to disable the button when the datagrid have 9 rows?
i want to control the button.after the datagrid have 9 rows, then the button.enabled=false.


Recommended Answers

All 3 Replies

Where is the button? in a row of the grid or outside?

See if this helps.

Private Sub DataGridView1_RowsAdded(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowsAddedEventArgs) Handles DataGridView1.RowsAdded
        If DataGridView1.RowCount = 10 Then Button1.Enabled = False
    End Sub

The button is outside.Thank you.
This thread is solved.^ ^

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.