Populating a GridView Inside a UserControl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Denden
    New Member
    • Aug 2014
    • 33

    Populating a GridView Inside a UserControl

    Hello everyone, i'm having a problem on how to populate my gridview since the gridview's are not within the same Form.

    Let me try to explain how the form is setup. Let's imagine i have a Button1, then Two Panels. Upon clicking the button1, i will add a custom control which contains a gridview inside of those two panels. Just like panel1.controls .add(controlToB eAdded).

    Everything works fine except when populating the gridview. I want to populate the gridview2 which is inside the panel2 base on the values from gridview1 which is inside the panel1. I'm passing data using delegates, i step on the code and i can see the data was passed successfully, i suspect the problem is because i created another instance of the control inside of the gridview click event handler. I can't think a better solution since i really need to create an instance of that control for me to be able to hook up my delegate.

    Thank you.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    What type of application is this?
    WPF or WinForms?

    If its WinForms, did you call the UI refresh in the code that the delegate executes?

    If it's WPF, did you properly raise notification events? If this isn't working, have you tried calling update target on your gridview's items source binding?

    Comment

    Working...