Ticket Q575199
Visible to All Users

ResourceStorage.DataSource property does not support IEnumerable<DataRowView>

created 11 years ago

Hello,

In my application I get the resources from a database, usually I assign the corresponding datatable as the ResourceStorage.DataSource.

The problem is, in certain cases I have to do some complex filtering on the resources.
I do that filtering using Linq.
I iterate over the DefaultDataView and select the corresponding DataRowView from my Resource datatable.

My problem is, it seems the ResourceStorage.DataSource doesn't support this kind of scenario.
When I assign my IEnumerable<DataRowView> to the DataSource property, no resources are detected.

If I do the same kind of filtering but I create an anonymous type and return an IEnumerable, then it works, but in my case it's not pratical.

Is there something to do to make the IEnumerable<DataRowView> method work ?

I've attached a simple projet showing the problem.

In the code, you can find two lines to switch from one IEnumerable to the other.

Thank you for your help.

Best regards.

Answers approved by DevExpress Support

created 11 years ago (modified 11 years ago)

Hi,
Our DataController doesn't work with DataRowView objects as you require, because they don't contain information about your data. We can work with typed objects or collections that implement the ITypedList interface. So, you can use anonymous objects or create a wrapper over your collection that implements the ITypedList interface.
Feel free to contact us if you need additional information.
Thanks

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.