DomainDataSource

There are 11 entries for the tag DomainDataSource
DomainDataSource Enum Filters

In early pre-release versions of RIA Services, the DomainDataSource control did not support filter descriptors for Enum properties.  We were able to get this fixed for our V1.0 RC release though, and I mentioned that back in March.  I said in that post that I’d follow up with details about our Enum support, but I never did (until now). Someone actually called me out on this by commenting on the post.  However, I thought the details of the comment were a bit humorous.  Here’s what I received in my inbox: So, you’ve asked me to point...

posted @ Friday, November 19, 2010 6:10 PM | Feedback (0)

DomainDataSource, ComboBox, and Load Blocking

Over on our forums, many of you have reported difficulty with the ComboBox control when using RIA Services.  Kyle McClellan (@KyleMcClellan) suggested that we drill into various ComboBox scenarios to see what works well and what doesn’t.  Our goal was to produce some samples that address common scenarios, and to offer general guidance for ComboBox usage. Here are a few scenarios we looked at: Async loading of ItemsSource with a SelectedItem/SelectedValue binding; Cascading drop-downs such as selecting Year - Make - Model for a car; Binding...

posted @ Tuesday, June 22, 2010 2:36 AM | Feedback (9)

Writing a Custom Filter or Parameter for DomainDataSource

This post comes to you from a guest writer, Kyle McClellan.  Kyle works with me on the RIA Services team and he’s contributed to the DomainDataSource feature (among many other features in the framework).  Kyle made the changes that allowed us to remove ControlParameter and use ElementName bindings for FilterDescriptor and Parameter that I recently blogged about. Now that the ControlParameter has been properly disposed of, you might have noticed that Parameter has changed substantially. Before, a Parameter was used for filtering, grouping, sorting, and querying. Now it is only used in the last case. If you...

posted @ Thursday, March 18, 2010 4:14 PM | Feedback (4)

DomainDataSource Filters and Parameters

Of all changes that made it into the RIA Services RC release, one of the ones that I'm happiest about is the deletion of a class called ControlParameter.  Yes, ControlParameter is gone, gone, gone--finally!  If you’re wondering how you’ll get your UI-based filters and parameters to work without ControlParameter, do not fret… it’s easy; just use an ElementName binding! Let’s take a look at the changes related to Filters and Parameters… ControlParameter is gone… Good Riddance! Since the inception of RIA Services, the DomainDataSource control has relied upon ControlParameter tags for specifying Filters and Query Parameters that...

posted @ Monday, March 15, 2010 7:24 PM | Feedback (26)

(Not) Doing Back Flips with DomainDataSource [SubmitChanges sends user to first page]

When changes are successfully submitted and you have paging enabled, it’s quite possible that some of the entities that have been edited now belong to a different page.  Say for instance you are viewing employees ordered by last name, and you edit one of the employees to change their last name, moving them from Jones to Adams.  After submitting changes, what should happen?  Should Adams continue to show up on the 6th page, or should the data be refreshed to place everyone where they belong? A few months ago, we made the decision to invoke a fresh load after...

posted @ Saturday, November 21, 2009 9:40 AM | Feedback (3)

DomainDataSource Error Handling

With the RIA Services July 2009 Preview release, we heard significant feedback about the DomainDataSource error handling story.  The biggest problem was when errors occurred during Load() or SubmitChanges(), server-side errors would be silently swallowed unless you opted into the LoadError, LoadedData, and SubmittedChanges events, and explicitly checked for errors.  With the PDC release, we've change this behavior, among others related to error handling. Different Error Conditions The DomainDataSource can encounter errors in several different ways: Load() is called when its prerequisites are not yet met.  For instance, there is no DomainContext specified, the...

posted @ Thursday, November 19, 2009 8:29 PM | Feedback (21)

DomainDataSourceView API (DomainDataSource.DataView)

DomainDataSource has two properties for getting the data out of it: Data and DataView.  The Data property is what’s intended for exposure in Binding scenarios, for instance binding a DataGrid to the DomainDataSource.  This property is typed very simply as an IEnumerable.  The DataView property however is intended to be used for programmatic access to the entities exposed by the DomainDataSource.  While the two properties currently return the same collection instance, this might not always be true, so it’s good to properly set the expectations of these two properties.  If you need to work with the collection from the DomainDataSource,...

posted @ Monday, November 16, 2009 3:58 PM | Feedback (4)

DomainDataSource DataPager PageSize Pitfall

During the PDC release milestone of RIA Services, we discovered an error from DomainDataSource when using AutoLoad="True" and when using a DataPager bound to the DomainDataSource’s Data property.  We found that when the PageSize property is specified on the DataPager and not on the the DomainDataSource itself, an exception would often (but not always) be thrown from DomainDataSource, indicating that a load could not be invoked while another load was in progress.  The reason for this will actually interest you most if you use AutoLoad set to False. The issue is easiest to explain with a series of events...

posted @ Monday, November 16, 2009 3:12 AM | Feedback (5)

DomainDataSource – Single Record Results

While the DomainDataSource is most often used for loading entire sets of records, it can also be used for loading a single record result.  This is a topic I’ve seen a few people talk about, assuming it’s a difficult thing to do, and even creating solutions for a problem that doesn’t exist.  I want to dispel the myth here: DomainDataSource can in fact be used to easily bind to a single record result. Let’s create a DomainService that has a method to get the most recent error from the AdventureWorks database: ...

posted @ Tuesday, November 10, 2009 10:33 AM | Feedback (2)

DomainDataSource.DataView

There have been a couple of discussions on the .NET RIA Services Forums regarding the DomainDataSource.DataView property.  Colin Blair tossed in a comment that relates to something we’re working on: This looks like as good a place as any to say I would like to see the actual object behind IEditableCollectionView exposed publically. … Right now, the DomainDataSource’s Data and DataView properties are returned as interfaces: Data is an IEnumerable, and DataView is an ICollectionView.  But behind the scenes, both of these properties return an instance of an EntityCollectionView,...

posted @ Tuesday, July 21, 2009 5:41 PM | Feedback (3)

DomainDataSource – Defining Its Limits

With the .NET RIA Services July 2009 Preview, the DomainDataSource now enables some scenarios that were previously blocked.  Most namely, we now allow you to change your current page while there are pending changes in the data.  Editing and paging seemed like a common enough scenario that we wanted to enable it, so we’ve done so in the recent drop. There are actually many scenarios opened up right now that we’re reviewing.  I’ll be frank: many of the following scenarios are probably doing really wonky things in the current bits.  So here’s your chance to help us determine how these scenarios...

posted @ Tuesday, July 14, 2009 3:45 AM | Feedback (15)