ComboBox Data Source

5 posts, 0 answers
  1. Chris
    Chris avatar
    15 posts
    Member since:
    Aug 2012

    Posted 04 May 2015 Link to this post

    I have grid with four columns. On load, I'm getting the data from a single table to populate the columns in the grid. Imagine a data with a column for uniqueID, text, text, numbers and numbers. I'm loading just the last for as visible.

    I want the user to have the ability to edit the first two columns. This data actually comes from another table. There may be five choices for the user to select.

    I'm looking everywhere for en event and I cannot find where I can edit the data source for the combobox columns. I'm completely stumped as to how I can populate the drop down boxes with valid data for the user to select.

  2. Dess
    Admin
    Dess avatar
    1607 posts

    Posted 07 May 2015 Link to this post

    Hello Chris,

    Thank you for writing.

    You can directly specify the GridViewComboBoxColumn.DataSource. If you set the ValueMember, DisplayMember properties you will set up the column on a way to display the desired values, but use another property/column from the DataSource for the value itself. Additionally, the GridViewComboBoxColumn.FieldName property gives you the opportunity to match the GridViewComboBoxColumn with a specific property from the RadGridView.DataSource. However, if you need to modify the available items in the GridViewComboBoxColumn later, it would be suitable to use the CellEditorInitialized  event and manipulate the editor's data source collection. 

    If you are still experiencing any further difficulties, it would be greatly appreciated if you provide a sample code snippet which replicates the undesired result. Thus, we would be able to investigate the precise case and assist you further. Thank you.

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Dess
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Chris
    Chris avatar
    15 posts
    Member since:
    Aug 2012

    Posted 07 May 2015 in reply to Dess Link to this post

    On load, I'm just loading the grid with the dataset fill statement for the one table. The SQL table has five rows, but I only display four of them.

     

    this.TableAdapter.Fill(this.DataSet.table);
    DataSetTableAdapters.TableAdapter loadTable = new DataSetTableAdapters.TableAdapter();

     

    This works great. The existing data is populated in the grid. The two columns I have that are comboboxes are at first populated with the data from the table. What I want is to have the the drop down populate with options from a different table.

    What I think you're telling me is I have to use CellEditorInitialized to then populate the drop down list for that cell.

     

    If so, can you point me to an example of that?

  5. Chris
    Chris avatar
    15 posts
    Member since:
    Aug 2012

    Posted 11 May 2015 Link to this post

    I'm extremely disappointed in Telerik. I guess progress has fired everyone who used to answer questions here. I've been waiti9ng days for a response and frankly that's unacceptable.

    The documentation for this co0ntrol is basically useless if you are doing real work.

     

    I am very unhappy.

  6. Dess
    Admin
    Dess avatar
    1607 posts

    Posted 12 May 2015 Link to this post

    Hello Chris,

    Thank you for writing back.

    Note that most of the forum threads are reviewed by Telerik representatives and we address the questions asked by our customers in the forums as well. Additionally, have in mind that the ticket response time for forum threads is 72 hours (work days).  Moreover threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread. You can refer to our Support Plans for DevTools: http://www.telerik.com/purchase/support-plans/devtools.

    As to the question related to GridViewComboBoxColumn, I have prepared a sample project demonstrating how to bind the column to a BindingSource and modify in the CellEditorInitialized event afterwards. 

    I hope this information helps. If you have any additional questions, please let me know.
     
    Regards,
    Dess
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready