Hi,
I am using Telerik's RadGridView to display some data. One of the columns in this gridview is a combobox, which is populated like so:
DataTable dtContractorName = A133DB.GetContractorsForCombo(true);
GridViewComboBoxColumn contractorNameColumn = new GridViewComboBoxColumn();
contractorNameColumn.UniqueName = "ContractorID";
contractorNameColumn.HeaderText = "Contractor";
contractorNameColumn.DataSource = dtContractorName;
contractorNameColumn.ValueMember = "ContractorID";
contractorNameColumn.DisplayMember = "ContractorName";
contractorNameColumn.FieldName = "ContractorID";
radGvReviews.Columns.Add(contractorNameColumn);
This works just fine for displaying the data properly in the gridview, but I would like to also show the displaymember of the current row on a separate part of my form when the cell is double-clicked.
Example:
private void radGvReviews_CellDoubleClick(object sender, GridViewCellEventArgs e)
{
MessageBox.Show(e.Row.Cells["ContractorID"].Value.ToString());
}
Unfortunately, this will only display the ValueMember for the column (i.e. 1, instead of Fred; 2, instead of Bob), and the control does not contain a definition for the "DisplayMember" or "Text" properties (where I would expect to find the value that is actually being displayed on screen).
Any ideas on this one?