New Posts New Posts RSS Feed: Ideablade retrieving data when we *leave* a field
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Ideablade retrieving data when we *leave* a field

 Post Reply Post Reply
Author
agrogers View Drop Down
Groupie
Groupie
Avatar

Joined: 11-Mar-2010
Posts: 41
Post Options Post Options   Quote agrogers Quote  Post ReplyReply Direct Link To This Post Topic: Ideablade retrieving data when we *leave* a field
    Posted: 14-Feb-2011 at 9:14pm
We have a problem that seems to be with IdeaBlade's automatic retrieval of data from related tables.  Our forms loads the data into a selection list on the left.  That selection list filters data on the right. 

We click on an item in the bound selection list and the data we want is retrieved and we can file the form correctly.  Good.

We then leave that control (say by clicking in an unbound, unrelated text box).  Immediately IdeaBlade goes off and retrieves additional data based on the relationships for the selected item.  Not so good.  This causes the application to feel sluggish since data is being retrieved for no purpose.

We can understand why that related data should be retrieved when the item is first selected.  That would be good.  But retrieving the data when we are finished with the item is causing us problems.

Why does this data retrieval happen *after* we have finished with the item and not when the item is first selected?  What can we do about avoiding this?

Thanks
Andrew
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 15-Feb-2011 at 2:45pm
I assume you're using DevExpress controls in WinForms, but without specifics I can offer only some general advice.
 
The leave/lost focus event on a UI control will also trigger validation, which if the DataSourceUpdateMode is OnValidated will also try to push changes to the data source.  Changes to the entity will trigger INotifyPropertyChanged, which will cause a listening UI control to refresh and possibly call TypeDescriptor.GetProperties in doing so.  This GetProperties call is usually the culprit behind any type of unwanted/unexpected property retrieval, since the getter will be called for all properties, including navigation properties.    I know you said you have a selection list, but some UI controls will think the data has changed even when it hasn't (because of parsing/formatting/masks).   If using a data or list converter you can set the Editability to ReadOnly to ensure property setters aren't unintentionally being called.
 
If you can't track down why TypeDescriptor.GetProperties is being called, other options are to data bind to a "wrapper" type which contains only the properties of interest or use a dynamic type; or if it makes sense, pre-load cache with the related data so that calls to the datasource are not made.
 
 
Back to Top
agrogers View Drop Down
Groupie
Groupie
Avatar

Joined: 11-Mar-2010
Posts: 41
Post Options Post Options   Quote agrogers Quote  Post ReplyReply Direct Link To This Post Posted: 15-Feb-2011 at 4:48pm
Thanks Kim.  We are using DevExpress controls.  You have given us some areas to look at it.  Will explore those and come back to you.

Cheers
Andrew
Back to Top
agrogers View Drop Down
Groupie
Groupie
Avatar

Joined: 11-Mar-2010
Posts: 41
Post Options Post Options   Quote agrogers Quote  Post ReplyReply Direct Link To This Post Posted: 15-Feb-2011 at 7:30pm

We have done a little work and sadly that hasn't helped directly ... but we did stumble across something else. The user control in which this list is located has a property called AutoValidate which by default results in a Validate request being sent to all controls in the user control. We set this to Disable and now we are ok in this form :)

However this doesn't solve the same problem elsewhere since we are not using usercontrols in other forms.  We need to do a little more reading to fully understand all you have described - we might be missing something. 

Thanks

Andrew

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down