The problem is this: I have a GridView with several columns and I want a few of them to contain LookUpEdit items. I get the same error in all of them so I'll share the easies one:
In this code there should be simply 2 options YES or NO but all I get is the null string value in them.
// Create a DataSet that contain the 2 values NO and YES and their keys
DataTable dsSiNO = new DataTable("dsSiNO");
dsSiNO.Columns.Add("Valor", typeof(Decimal));
dsSiNO.Columns.Add("Tipo");
dsSiNO.Rows.Add(0, @""+MsgResources.GetString("MsgNo"));
dsSiNO.Rows.Add(1, @"" + MsgResources.GetString("MsgYes"));
// Create the LookUpEdit variable and set it's options
DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit myLookup = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit();
myLookup.ShowHeader = false;
myLookup.ShowFooter = false;
myLookup.DataSource = dsSiNO ;
myLookup.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Valor"));
myLookup.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Tipo"));
myLookup.DisplayMember = "Tipo";
myLookup.ValueMember = "Valor";
// Finally set the LookUpEdit object to the column
gColNEGOCIO.ColumnEdit = myLookup;
All I get are cells with an "[Empty]" String.
The problem was in the GridView configuration: the OptionsBehavior Editable was set to False!!!