items.add for ComboBox

6 posts, 0 answers
  1. Jeff
    Jeff avatar
    62 posts
    Member since:
    Apr 2012

    Posted 14 Jan 2013 Link to this post

    I'm not able to find a working example of what I need. They are either outdated and not compatible with 2012 Q3 or they don't apply.

    I need the Telerik version of
    Dim GuestCB As DataGridViewComboBoxCell
    GuestCB = DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("Guests")
                    For Each RV2 As DataRowView In DV2
                        Dim Row2 As DataRow = RV2.Row
                        GuestCB.Items.Add(DVGuests.Table.Rows(DVGuests.Find(Row2(2)))("LookupName"))
                    Next

    DV2 is a filtered DataView that changes with each row, that's why I fill the ComboBox manually. This is just for display purposes - nothing is selected.
  2. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 17 Jan 2013 Link to this post

    Hi Jeff,

    Thank you for writing.

    Please refer to the following documentation article which explains how you can work with GridViewComboBoxColumn and how you can populate it with data: http://www.telerik.com/help/winforms/gridview-columns-gridviewcomboboxcolumn.html .

    I hope that you find this information useful.

    Regards,
    Stefan
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  3. Jeff
    Jeff avatar
    62 posts
    Member since:
    Apr 2012

    Posted 17 Jan 2013 Link to this post

    I don't see how do accomplish what I need. I can't bind the column because each row will present different options in the combobox. The combobox will show a list of Guests that are attending the appointment specified in the row. 
    Row 1 might show
    Bob
    Angela
    Samuel

    and Row 2 might show
    Sarah
    Steven
    Rachel

    Is my only option to filter the data each time someone clicks the combobox? I want to be able to show the first guest in the combobox.text.
  4. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 21 Jan 2013 Link to this post

    Hi Jeff,

    Please take a look at this Knowledge Base article, which demonstrates how to achieve the desired functionality: http://www.telerik.com/support/kb/winforms/gridview/cascading-comboboxes-in-radgridview.aspx.

    I hope you find it useful.

    Regards,
    Stefan
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  5. Jeff
    Jeff avatar
    62 posts
    Member since:
    Apr 2012

    Posted 13 Feb 2013 Link to this post

    Stefan,

    thank you for the reply. Each row will have one or more guests and many rows may share one or more guests. Because of this each row must be assumed to use a unique list of guests. This method seems to require that I create a new list for every row. If I have 5000 rows then I will have 5000 lists. Is this true?

    Thank you,
    Jeff
  6. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 18 Feb 2013 Link to this post

    Hello Jeff,

    The approach requires you to bind the column to all possible values you need to display in its cells and then, bind each editor to a subset of these values, so if you need unique list of guests per row and you have 5000 rows, will end up with 5000 lists at some point.

    If this does not work for you, feel free to check if our hierarchical grid functionality might suit your needs: http://www.telerik.com/help/winforms/gridview-hierarchical-grid-binding-to-hierarchical-data.html. Example of hierarchical grid are available in our Demo application > Hierarchy.

    I hope that you find this information useful.

    All the best,
    Stefan
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top