StrataFrame Forum

BusinessObject.Navigate doesn't change the selected value of a bound Devxpress LookUpEdit control

http://forum.strataframe.net/Topic12973.aspx

By George Nentidis - 12/11/2007

Hello,

I have a LookUpEdit control and an XtraGrid on the same win form and they are both bound to the same BusinessBindingSource. When I use BusinessBindingSource.BusinessObject.Navigate to an absolute index position, I see the Grid focusing correctly on the row at the specified position, but the display text of the LookUpEdit doesn't change to point to the value I navigated to.

Is this normal? The call is like this (bs is the BusinessBindingSource and foo is true):

bool foo = bs.BusinessObject.Navigate(BusinessNavigationDirection.Absolute, bs.BusinessObject.CurrentRowIndex);

I am using DevXpress version 6.3

Thanks in advance.

By Trent L. Taylor - 12/11/2007

If the LookupEdit control is bound and the value of the bounds control changes, the control should update its binding and be reflected in what is visible.  I know that this will work in the Infragistics controls and the DevExpress should not be any different in that respect.  If you bind the same field to a DevExpress textbox, does its value update?
By George Nentidis - 12/11/2007

I checked it and now I have 3 bound controls on my form, a TextEdit, a LookUpEdit and an XtraGrid. They are all bound to the same BusinessBindingSource and the TextEdit and Grid work correctly! When I change the source position in either of them (either by hand or by code), the other also changes immediately to reflect the new position in the datasource.

Only the LookUpEdit remains unchanged, until I set its value either programmatically or by hand. Also if I change the value of the LookUpEdit, the rest of the controls don't bother to update, as if the Lookup is not bound.

I guess then this is a DevXpress issue...

By Trent L. Taylor - 12/11/2007

I would have to look at your code to see what is going on.  I do know that when we created the wrapper for DevExpress that their combo behaved differently than many of the other native controls and in fact did not have a standard data source like a .NET combo.  This required that we add this functionality in the wrapper.  Since you are using the standard .NET data-binding through the BBS, if their control is not reflecting the change then it would be one of two things:

  1. You have some logic within the control that is preventing it from reflecting the navigated record.
  2. The LookupEdit control is not respecting the navigation and updating of the BBS.  You may look at the data-bindings and ensure that the control updates itself on the PropertyChanged event rather than the Validated.  This is done for you automatically through the wrapper by default.  But when you bind natively you have to set this yourself.  To get to this, go to the Data Bindings->Advanced.  Select the property to which you are binding and change it to OnPropertyChanged.