I'm building a Grid that lists a collection of data that comes from multiple sources. One of those sources is a web service so it's possible that the web service call might fail. If it does, I still want to display the data from the other sources, but I want to display a warning on the page that the web service data is not included in the results. I have a ViewModel containing this property:
public
class
MyVM
{
public
bool
ServiceUnavailable {
get
;
set
; }
public
List<RowVM> GridData {
get
;
set
; }
}
So I could show the warning when the Grid first loads. However, I'm not actually going to populate GridData during the initial page load. I want the Grid to make an AJAX call to load the first page (and for any other paging.) So after each Read action completes, I need to check if ServiceUnavailable and display the warning if it is true. The problem is, the Read action only returns a List<RowVM>.ToDataSourceResult(). How can I return additional data that is separate from the Grid row data? Is there a way to override the client-side Read function to make my own AJAX call and then on success update the datasource with the returned data myself?