Solved

Data Binding to the Visible property on a drop down

Posted on 2009-07-15
2
190 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now