I am using the LookUpEdit control. I bound two columns, a primary key (GUID) and a human readable string. I only want people to see the human readable string, but I want to preserve the relationship between the string value and it's primary key value.
I can't seem to hide the primary key from displaying on dropdown. I've tried the DevExpress forum and their proposed solution does not work for me. So I tried hooking into the ListChanged event. That is not working either.
private void DataBind()
{
messageTypeCbB.ListChanged += new ListChangedEventHandler(messageTypeCbB_ListChanged);
messageTypeCbB.Properties.DataSource = viewModel.SomeNoteTypes.ToArray();
//another attempt at hiding the columns. This fails too.
//messageTypeCbB.Properties.ForceInitialize();
//messageTypeCbB.Properties.PopulateColumns();
//messageTypeCbB.Properties.Columns[0].Visible = false;
messageTypeCbB.Properties.DisplayMember = "NodeType";
messageTypeCbB.Properties.ValueMember = "SomeNoteType_ID";
fromTxt.Text = viewModel.From;
dateTimeDd.DateTime = viewModel.Date;
}
void messageTypeCbB_ListChanged(object sender, ListChangedEventArgs e)
{
//For whatever reason this won't hide the column
(sender as DevExpress.XtraEditors.LookUpEdit).Properties.Columns[0].Visible = false;
}
How can I hide the surrogate key? (Hide ValueMember display only DisplayMember)
DevExpress v11.1.6