I am using Telerik RadGridView to display some data. One of the columns in this gridview is a combobox that populates like this:
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 is great for displaying data correctly in a gridview, but I would also like to show the displaymember of the current row in 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 (for example, 1 instead of Fred; 2 instead of Bob), and the control does not contain a definition of the "DisplayMember" or "Text" properties (where I will expect to find the value that actually appears on the screen) .
Any ideas on this?