Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Data Binding to the Visible property on a drop down

Posted on 2009-07-15
2
Medium Priority
?
205 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Assisted Solution

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

Accepted Solution

by:
jinal earned 1400 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

670 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