How to extract GridViewComboBoxColumn value

2 posts, 0 answers
  1. Vahagn Hokhikyan
    Vahagn Hokhikyan avatar
    6 posts
    Member since:
    Feb 2005

    Posted 06 Oct 2007 Link to this post

    Hi dear rep of telerik,
    I have a GridViewComboBoxColumn in my gridview and would like to extract the selected text (given by DisplayMember property) programatically.

    here is my column declaration

    Dim clubManagerColumn As New GridViewComboBoxColumn
    clubManagerColumn.HeaderText =
    "Club Manager"
    clubManagerColumn.DataField = "manager_stuff_id"
    clubManagerColumn.DataSource = StaffBindingSource
    clubManagerColumn.ValueMember =
    "staff_id"
    clubManagerColumn.DisplayMember = "staff_name"
    ClubRadGridView.MasterGridViewTemplate.Columns.Add(clubManagerColumn)

    when I try 

    ClubRadGridView.CurrentRow.Cells("club_address_id").Value

    I am getting the value for the DataField property, instead I would like to get the selected value of the DisplayMember property.

    thank you!

  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 08 Oct 2007 Link to this post

    Hello Vahagn Hokhikyan,

    We confirm that the cell's Value property gets the DataField property instead of the DisplayMember. We would suggest using the following code to get text of ComboBoxColumn

    ClubRadGridView.CurrentRow.Cells ( "club_address_id" ). CellElement.Text

    Hope that helps.

     
    Regards,

    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top