Data binding.

  • Thread starter Thread starter Jacek Jurkowski
  • Start date Start date
J

Jacek Jurkowski

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.DataBindings.Add("Text",a,"Archiw");
}

Button Text is binding to ARCHIW property instead
of Archiw in that case. How to force it to bind Archiw?
 
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
 
Back
Top