This is a migrated thread and some comments may be shown as answers.

Bind data to ComboBoxes in GridView

1 Answer 225 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Maciej
Top achievements
Rank 1
Maciej asked on 25 Apr 2013, 07:37 AM
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

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 29 Apr 2013, 12:34 PM
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.
Tags
GridView
Asked by
Maciej
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or