Populate Rad Combo Box inside Rad Grid View

2 posts, 0 answers
  1. Aries
    Aries avatar
    2 posts
    Member since:
    Sep 2013

    Posted 05 Sep 2013 Link to this post

    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
  2. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 06 Sep 2013 Link to this post

    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 >>
Back to Top