开发者

struggling to populate lookupEdit problem!

I am using the devexpress lookupedit control, and I have set the EditValue property(SocklocationBindingSource - Location). When you click on the black little arrow ON the control itself, the datasource, displaymember an开发者_StackOverflow中文版d valumember are set. I run my app and see [editvalue is null] in the actual control?

What else must i set? What on earth am i doing wrong?

I use VS 2009


Are you trying to populate the lookUpEdit by all locations in the datasource + make EditValue take the selected location?, if so you can do this:

lookUpEdit1.Properties.DataSource = SocklocationBindingSource;
lookUpEdit1.Properties.DisplayMember = "Location";
lookUpEdit1.Properties.ValueMember = "Location";
lookUpEdit1.Properties.PopulateColumns();

(via Code or Designer)


You are not doing anything wrong, the LookUpEdit control does not have an EditValue by default. Consider data binding the EditValue property to an object. If you have already done this then you could set a default edit value to get the editor to function.

Also, the 'EditValue is Null' flavor text can be changed in Properties.NullText.


Did you set the Properties->Columns values?


I had the same problem you described, but it depends on how you are using the data, what data structures you are using, the events you are using, etc...

Here's what worked for me: http://www.devexpress.com/Support/Center/p/Q350641.aspx


You must bind the SocklocationBindingSource with a proper data source such as an IList or Datatable.

ex:

SocklocationBindingSource.DataSource = MyBiz.GetAllObjs();

[editvalue is null] is displayed when the DataSource is null. You can change this in properties.


Definition you should check the DisplayMember and ValueMember property. View an example here: http://itjungles.com/devexpress/how-to-easily-populate-devexpress-lookupedit-in-c

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜