Solved

Data Binding to the Visible property on a drop down

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

708 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

15 Experts available now in Live!

Get 1:1 Help Now