Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
Databinding in WPF on a to WinSchedule on a custom user control
posted

Hello,

I am trying to write a user control in WPF that has a WinSchedule on it.  Everything shows up ok, and it seems to work fine, but I can't get it to databind.  I copied a sample from here and created a table and am filling it up and then calling all of the relevant  DataBindingsForAppointments.  However, O cannot call            DataBindingsForAppointments.BindingContextControl = this; because this is a user control and not a Windows.Form.  Is this what is causing my databinding not to work, and if so, what am I supposed to set the BindingContext or BindingContextControl to if I am hosting the control in a user control?

  • 50
    Offline posted

    Sorry, I solved my own problem.  I just needed some BindingContext, so I created a new  System.Windows.Forms.BindingContext variable in the control and set the DataBindingsForAppointments.BindingContext = to it, so I am good to go.