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

Populate Rad Combo Box inside Rad Grid View

1 Answer 264 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Aries
Top achievements
Rank 1
Aries asked on 05 Sep 2013, 08:13 AM
Hi,

I'm using telerik rad controls and I've encountered roadblocks.

I've application that have RadGridView with multiple RadComboBox different datasource.

Questions:

How I'll bind a specific cell in RadGridView with ComboBox? Please see my codes below.

        private void grdList_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            DataTable dt = PopulateList();

            GridViewComboBoxColumn comboCol = e.Column as GridViewComboBoxColumn;
            comboCol.DataSource = dt;
            
            ((GridViewComboBoxColumn)e.Column).DataSource = dt;
        }

This code bind all the Rad Combo and I want only the specific cell..

Like this one on DataGridView

                (grdList.Rows[e.RowIndex].Cells[4] as DataGridViewComboBoxCell).DataSource = _dt;
                (grdList.Rows[e.RowIndex].Cells[4] as DataGridViewComboBoxCell).ValueMember = "CODE";
                (grdList.Rows[e.RowIndex].Cells[4] as DataGridViewComboBoxCell).DisplayMember = "NAME";

Thanks

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 06 Sep 2013, 11:22 AM
Hello Aries,

A DataSource is supported per column only and you can't bind a specific cell to a different data source. You can, however, bind the editor shown for a specific cell to a specify data source. Please note that this data source should be a subset of the datasource bound to the while column. For additional information, please refer to the following article: Cascading ComboBoxes in RadGridView.

In the example given in the article the editor is bound to a subset (vegetables or fruits) of the main data source used to the GridViewComboBoxColumn.

I noticed that you wrote about the same enquiry in this forum thread. I would kindly ask you to use just one support channel to contact us about a particular question. This will allow our community to find the answer to the question more easily and will also allow us to provide you with a quicker response because we will need to review one thread instead of two.
 
Regards,
Nikolay
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Aries
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or