Designer/properties databinding, how???

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Julie (julie_at_nospam.com)
Date: 11/11/04

  • Next message: John Saunders: "Re: Designer/properties databinding, how???"
    Date: Thu, 11 Nov 2004 13:10:35 -0800
    
    

    I'm trying to use data bindings through the control designer properties, and
    getting
    nowhere at light-speed. The online help for data bindings is virtually useless
    as a tutorial on the subject, and I haven't been able to locate anything
    through Google.

    I've set up data bindings manually, and they work just fine, but I'm just
    trying to figure out how to do it through the property page for the control.
    Manually (simplified), this is what I have (C# windows form app):

    public class Parameters
    {
      private string userName;
      public string UserName
      {
        get { return userName; }
        set { userName = value; }
      }
      // etc.
    }

    public class MyForm : Form
    {
      private Parameters parms = new Parameters();
      private TextBox txtUserName;

      public MyForm()
      {
        InitializeComponent();
        txtUserName.DataBindings.Add(new Binding("Text", parms, "UserName"));
      }
      // etc.
    }

    and everything works just dandy.

    *However*, what I want to be able to do is to create the databinding
    automatically through the property page DataBindings. For the txtUserName
    control, the DataBindings Text drop down has (none), and if I type something
    like parms.UserName, I get an "Invalid property value" error. I've tried
    "parms.UserName", parms, "UserName", etc., and nothing works.

    So, finally my question: where is some decent documentation & tutorial on how
    to use the DataBindings from the property page? Anyone have any comments on
    correct usage?


  • Next message: John Saunders: "Re: Designer/properties databinding, how???"

    Relevant Pages

    • Designer/properties databinding, how???
      ... The online help for data bindings is virtually useless ... trying to figure out how to do it through the property page for the control. ... public string UserName ... automatically through the property page DataBindings. ...
      (microsoft.public.dotnet.framework.windowsforms.databinding)
    • Data binding syntax?
      ... I'm trying to use data bindings through the control properties, ... trying to figure out how to do it through the property page for the control. ... public string UserName ... automatically through the property page DataBindings. ...
      (microsoft.public.vsnet.ide)
    • Data binding syntax?
      ... I'm trying to use data bindings through the control properties, ... trying to figure out how to do it through the property page for the control. ... public string UserName ... automatically through the property page DataBindings. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Data binding syntax?
      ... The online help for data bindings is virtually useless ... > trying to figure out how to do it through the property page for the control. ... > public class MyForm: Form ... > automatically through the property page DataBindings. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Data binding syntax?
      ... The online help for data bindings is virtually useless ... > trying to figure out how to do it through the property page for the control. ... > public class MyForm: Form ... > automatically through the property page DataBindings. ...
      (microsoft.public.vsnet.ide)