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
populating custom or unbound column from webservice call
posted

My grid is bound to a collection of SrvItem objects, unfortunately, I need to also display some ancillary data in each row the requires another webservice lookup using one of the fields of the SrvItem object.  At first, I thought I'd use an Unbound column and a ValueConverter, but that won't work due to the the asynchronous nature of WCF Data Service calls. Basically I;d need to do something like this to get the data I need:

                DataServiceQuery<CIRCUIT> query = (DataServiceQuery<CIRCUIT>)from c in MainPage.context.CIRCUITs.Expand("EQUIPMENTs") where c.PCIRCUITGROUP_Id == item.CCIRCUITGROUP_Id select c;

                query.BeginExecute(result => App.Current.RootVisual.Dispatcher.BeginInvoke(() => 

                        {

                            data = query.EndExecute(result).ToList();  // get the data

                           // then massage the data and display it in the unbound or custom column

                        }), null);

Since a ValueConverter won't work, could I perhaps create a custom column type and somehow bind it to item.CCIRCUITGROUP_Id but make it display a custom value based on the results of the async query?