This is a migrated thread and some comments may be shown as answers.

How to extract GridViewComboBoxColumn value

1 Answer 189 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vahagn Hokhikyan
Top achievements
Rank 1
Vahagn Hokhikyan asked on 06 Oct 2007, 07:45 PM

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!

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 08 Oct 2007, 02:09 PM
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
Tags
GridView
Asked by
Vahagn Hokhikyan
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or