Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4606014
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:30:30+00:00 2026-05-22T00:30:30+00:00

I have a combobox in a user control and i want to data bind

  • 0

I have a combobox in a user control and i want to data bind it but the only things i have access to in the properties menu of the visual studio 2008 designer view is the data source and display member. Is there a way to setup the usercontrol so i can edit the selected value member in the properties menu too?

[System.ComponentModel.ComplexBindingProperties("DataSource", "DisplayMember")]
public partial class CustomComboBox : UserControl
{
    private object dataSource;
    private string displayMember;


    [AttributeProvider(typeof(IListSource))]
    public object DataSource
    {
        get
        {
            return this.dataSource;
        }

        set
        {
            this.dataSource = value;
        }
    }

    public String DisplayMember
    {
        get
        {
            return this.displayMember;
        }

        set
        {
            this.displayMember = value;
        }
    }

    public CustomComboBox()
    {
        InitializeComponent();
    }

    private void BindComboBox()
    {
        if (this.dataSource == null || this.displayMember == null)
        {
            return;
        }

        Binding binding = new Binding("DataSource", this.dataSource, this.displayMember, true);
        Binding binding2 = new Binding("DisplayMember", this.dataSource, this.displayMember, true);
        this.comboBox1.DataBindings.Clear();
        this.comboBox1.DataBindings.Add(binding);
        this.comboBox1.DataBindings.Add(binding2);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:30:32+00:00Added an answer on May 22, 2026 at 12:30 am

    I ended up adding a property for every field i wanted to edit and added [Browsable(true)] above all the properties. This let me edit everything as a text field in the properties menu.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a combobox that I don't want users adding new data too, but
I have a user control with a ComboBox and a TextBox. Everything is working
I have a ComboBox that has an associated ErrorProvider in the user control it
I have a ComboBox in WPF which is databound, and has data template which
Inside my user control I have a collection call Solutions public List<string> Solutions {
I have a function that presents the user a combo-box. def select_interface(interfaces) list_box :items
I have a ComboBox that I set up like this: this.cmbCustomerJob.DisplayMember = display; this.cmbCustomerJob.AutoCompleteMode
I have a ComboBox hosted in a ListView and I need changes in the
I have a ComboBox inside of a cell of a DataGridView Row on a
I have a ComboBox bound to an ObservableCollection of decimals. What is the correct

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.