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

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.