hi

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.

tq.

Recommended Answers

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

Jump to Post

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 learning and sharing knowledge.