开发者

Silverlight: Populate Nested Datagrid when the parent datagrid row is selected

开发者 https://www.devze.com 2023-03-18 08:06 出处:网络
I am having problem loading data into Nested datagrid. When the user clicks on a row in parent datagrid, The id is retrieved and based on that the nested datagrid is loaded.

I am having problem loading data into Nested datagrid. When the user clicks on a row in parent datagrid, The id is retrieved and based on that the nested datagrid is loaded.

In the rowDetailsVisibilityChanged event.

        DataGrid nestedDataGrid = e.DetailsElement as DataGrid;

        SampleObj data= e.Row.DataContext as SampleObj ;

        var client = new MyService.SampleServiceClient();
        client.GetReportArchiveDataCompleted += GetSampleDataCompleted;
        client.GetSampleDataAsync(data);

How can I add this line in Asyn completed event as I am not able to get the nested Datagrid in completed event.

IEnumerable dataL开发者_如何学运维ist= e.Result; nestedDataGrid.ItemSource = dataList


use an anonymous function instead....

client.GetReportArchiveDataCompleted += 
  delegate(object sender1, GetReportArchiveDataCompletedArgs e1) {
    nestedDataGrid.ItemSource=(IEnumerable)e1.Result;
  };

Obviously change the delegate to the correct signature (same as your GetSampleDataCompleted.

0

精彩评论

暂无评论...
验证码 换一张
取 消