Populate GridViewMultiComboBoxColumn with Dataset

4 posts, 0 answers
  1. ISB-developer
    ISB-developer avatar
    21 posts
    Member since:
    Jul 2011

    Posted 07 Nov 2011 Link to this post

    Is it possible to populate a column from a radGridView that has type RadGridMultiComboBoxColumn with a Dataset?
    I want to fill each cell on event 'BeginEdit' and clear on EndEdit event
    Can somebody help me?
    Thanks
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 10 Nov 2011 Link to this post

    Hello Isb-Developer,

    Thank you for writing.

    You can bind GridViewMultiComboBoxColumn to a table from the DataSet and not the DataSet itself. Simply set the DataSource property of the column to the dataset table, and set the display and value members:
    GridViewMultiComboBoxColumn col = new GridViewMultiComboBoxColumn();
    col.DataSource = set.Tables[0];
    col.DisplayMember = "Name";
    col.ValueMember = "ID";

    Then on CellBeginEdit, you can fill any data to the table that the column is bound to.

    I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.
     
    Kind regards,
    Stefan
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

  3. UI for WinForms is Visual Studio 2017 Ready
  4. ISB-developer
    ISB-developer avatar
    21 posts
    Member since:
    Jul 2011

    Posted 10 Nov 2011 Link to this post

    Yes I have understand. But is it possible to bind each cell from one GridViewMultiComboBoxColumn (GVMCBC) individually to a table from a dataset?
    So, let's say I have only one column with type GVMCBC and I want different values for the dropdown list values.
    For example for first cell I need to have three options (A, B, C) ; for next cell I need to have A, B, C, and D ; for other cell I need to have B and C. So, for each cell I need to create a dropdown list with different values.
    Is it possible?
    Or the only possibility is to bind the entire column to a table from a dataset?
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 15 Nov 2011 Link to this post

    Hello Isb-Developer,

    It is possible to bind each cell individually. Such functionality is described in the following Knowledge Base article for GridViewComboBoxColumn, but the same approach applies to GridViewMultiComboBoxColumn with its RadMultiColumnComboBoxElement editor. Attached you can find a sample demo application with the desired functionality.

    I hope this helps.

    Kind regards,
    Stefan
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Back to Top