Bind data to ComboBoxes in GridView

2 posts, 0 answers
  1. Maciej
    Maciej avatar
    7 posts
    Member since:
    Feb 2012

    Posted 25 Apr 2013 Link to this post

    Hi all,
    I don't know how to bind data to comboboxes columns in gridview control.
    I'm using this to bind data to grid view:
    private void Form1_Load(object sender, EventArgs e)
    {
                model = new DataModel.Entities();
                dataSource = new BindingSource();
     
                radGridView1.TableElement.BeginUpdate();
                dataSource.DataSource = model.Items.ToList();
                radGridView1.DataSource = dataSource;
                radGridView1.TableElement.EndUpdate();
    }

    Two of data field are foreign keys to another table. I would like to bind data from another table to my combo box editor.
    To get data from database I'm using OpenAccess ORM for PostgreSQL.

    Regards,
    Maciek
  2. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 29 Apr 2013 Link to this post

    Hello Maciek,

    Thank you for writing.

    Please, refer to the online documentation regarding the GridViewComboBoxColumn. There you will find examples how to populate the column and how to work with it.

    On a side note, when you assign a data source to RadGridView, you do not need to call the begin/end update methods, as they are called internally.

    I hope this will be useful. Should you have further questions, I would be glad to help.
     

    Greetings,
    Stefan
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Back to Top