views:

43

answers:

1

Hai all, Am using DevExpress LookupEdit in C#.NET project,also set both Display Member and Value member property of LookupEdit and items are not dispaying on LookupEdit list page ,but i can select items. After selecting one item the selected item dispayed on LookupEdit text. Please help

lkpReference.Properties.DataSource = _lab.selectLabReference() ;
lkpReference.Properties.DisplayMember = "refernce_name";
lkpReference.Properties.ValueMember = "lab_ref_id";
lkpReference.Properties.BestFitMode = BestFitMode.BestFit;
lkpReference.Properties.SearchMode = SearchMode.AutoComplete;

LookUpColumnInfoCollection collns = lkpReference.Properties.Columns;

collns.Add(new LookUpColumnInfo("Lab Reference", 0));
lkpReference.Properties.AutoSearchColumnIndex = 1;
+1  A: 
lkpReference.Properties.DataSource = _lab.selectLabReference() ;
lkpReference.Properties.DisplayMember = "refernce_name";
lkpReference.Properties.ValueMember = "lab_ref_id";
lkpReference.Properties.BestFitMode = BestFitMode.BestFit;
lkpReference.Properties.SearchMode = SearchMode.AutoComplete;

// the constructor you are using accepts 2 parameters: FieldName (which is the name
// of the field from the DataTable) and Width (which is the width of the column
// displayed in the dropdown). You have set both parameters wrong.

//LookUpColumnInfoCollection collns = lkpReference.Properties.Columns;
//collns.Add(new LookUpColumnInfo("Lab Reference", 0));

// what you intended to do is this
lkpReference.Properties.Columns.Add(new LookUpColumnInfo("refernce_name", 100, "Lab Reference"));

lkpReference.Properties.AutoSearchColumnIndex = 1;
devnull
method _lab.selectLabReference() return Data Table contain refernce_name, lab_ref_id values.
Vyas
Actual problem is item in the item list of LookupEdit is not visible but i can select that items.please help
Vyas
Thanks a lot .Its working Now
Vyas