Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
795
various odata questions binding to XamGrid
posted

I'm binding a grid to some SQL data via WCF Data Services (i.e.oData) very similar to the nicely done ODataXamGrid example I found on your blog however my schema is considerably more complex than Northwind unfortunately.  I've been able to deal with all the issues except a few:

1.  I have a SrvItem table that does parent/child via a column relationship where you have ParentItemID and ItemID and ParentItemID is null for the top level nodes and set to the ItemID of the parent for the child nodes.  Ideally, for display purposes, I would only show the parent type rows and then use an unbound column to aggregate and display the field I want from all the children under that parent but I haven't been able to figure out how to do that.  Anyone ever do something similar? Had the parent/children been stored in different tables via a foreign key relationship it would be easy, but since they are all in one table it doesn't exactly fit the odata paradigm very well.  Seems like, after all the SrvItems are loaded, if I could somehow iterate the collection and remove the children but as I do so, accumulate the one field I want from each child and somehow stick that aggregate value into my UnboundColumn on the parent it would work but I fear it is probably easier said than done.  Anyone ever done something similar?

2. How do you make the filtering stuff work for null values?  In the aforementioned example the ParentItemID is an Int32 type field but null is used - null shows up as blank - but I can select = from the filter option and leave it blank and have it match.   Similarly, in other tables with dates, this particular package uses null to represent.  If I setup ValueConverters will filtering automatically use them?