Data binding.

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?
 
M

Marc Gravell

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top