Data binding.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jacek Jurkowski

    #1

    Data binding.

    How to make DataBinding Case Sensitive?

    public class aaa
    {
    public String ARCHIW{ get{return "aaa"};}
    public String Archiw{ get{return "bbb"};}
    }

    public class bbb : Form
    {
    aaa a = new aaa();
    this.Button1.Da taBindings.Add( "Text",a,"Archi w");
    }

    Button Text is binding to ARCHIW property instead
    of Archiw in that case. How to force it to bind Archiw?
  • Marc Gravell

    #2
    Re: Data binding.

    Basically, you will struggle.

    Although this is legal C#, it really isn't a good idea as you will
    make it very hard both for UI (or other binding) purposes, and for any
    non-C# callers (VB is case-insensitive for example, and won't be able
    to use your properties).

    The right thing to do here is to rename one of the properties;
    sometimes you need to be pragmatic rather than pure - another example
    of this si when people ask how to have a property/class called
    "System" - you can do it, but it makes life very, very awkward for
    very little gain.

    Marc

    Comment

    Working...