Dtagridview The data source is bound, if you want the data condition to appear, you will get an error by using My_row.visible = False, and the error type is "The row associated with the location of the currency manager cannot be set to invisible" If you encounter such a problem, Then you can refer to the code.
Private Sub button2_click (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles button2.click Try D im cm as CurrencyManager = BindingContext (datagridview1.datasource) cm. SuspendBinding () ' suspends the binding for each My_row as DataGridViewRow in Datagridview1.rows If Trim (my_row.cells (0). Value) = "Xiaoming" then my_row.visible = True ElseIf not my_row.cells (0). Value = "Then ' ignores the last line blank line my_row.visible = False end If Next cm. ResumeBinding () ' Recover bound Catch ex as Exception MsgBox (ex. Message) end Try ' button1.enabled = True ' button2.enabled = False End Sub
Octopus Brother production-vb.net DataGridView bound data Source "The row associated with the location of the currency manager cannot be set to invisible" resolution of the issue