Solved

Data Binding to the Visible property on a drop down

Posted on 2009-07-15
2
192 Views
Last Modified: 2013-12-17
I can successfully databind to the Checked property of a checkbox:

            cboxRampEnabled.DataBindings.Clear();
            cboxRampEnabled.DataBindings.Add("Checked", _devicePresenter.Prescription, "RampEnabled");

but I can not databind to the Visible property of a drop down:

            ddlHidden.DataBindings.Clear();
            ddlHidden.DataBindings.Add("Visible", _devicePresenter.Prescription, "IsHiddenFieldVisible");

IsHiddenFieldVisible is a public boolean property of the object specified by _devicePresenter.Prescription.

Does anyone have any ideas? Does anyone know this is not possible?

Please let me know.

Thanks,
newbieweb
0
Comment
Question by:newbieweb
2 Comments
 
LVL 8

Assisted Solution

by:RyanAndres
RyanAndres earned 150 total points
ID: 24864330
Looks right to me, whats the error details/message?
0
 
LVL 15

Accepted Solution

by:
jinal earned 350 total points
ID: 24865721
Hello ,

I attached sample.  It works in my case.

IsHiddenFieldVisible property is boolean or anotehr data type.

 public class Test
    {
        public bool Visible
        {
            get;
            set;
        }
    }
   
    public partial class Form1 : Form
    {
        public Form1()
        {
           InitializeComponent();          
            Test t = new Test();
            t.Visible  = false;
            comboBox1.DataBindings.Add("Visible", t, "Visible");
        }
        
    }

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question