Silverlight Master/Detail DataGrid. How to access Detail DataGrid to set ItemsSource?

In a typical Master/Detail situation...

 I have a DataGrid. The ItemsSource of this DataGrid is set in the Completed event of a WCF call - (grdMaster.ItemsSource = e.Result) - where the x:Name of the grid is grdMaster. This is all 100%.
 However, when adding a Detail Datagrid inside the master grids DataTemplate and naming it appropriately... my codebehind does not recognise the detail grid. So plainly put, I cannot set the ItemsSource of grdDetail like I do with grdMaster.So how i can fill my detail datagrid ?
KekosavarAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KekosavarAuthor Commented:
14 hours and still no answers , nice...
0
Bob LearnedCommented:
Can you explain how you have this master/detail configured, please?
0
KekosavarAuthor Commented:
<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="DigiEcz.MusteriListe"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot">
       
        <sdk:DataGrid x:Name="dgCustList" AutoGenerateColumns="False" Background="Transparent" SelectionChanged="dgCustList_SelectionChanged">
            <sdk:DataGrid.RowDetailsTemplate>
                <DataTemplate>
                    <StackPanel>
                        <sdk:DataGrid x:Name="dgCustDetail" RowDetailsVisibilityMode="VisibleWhenSelected" AutoGenerateColumns="False"  Background="Transparent"/>
                    </StackPanel>
                </DataTemplate>
            </sdk:DataGrid.RowDetailsTemplate>
        </sdk:DataGrid>
        <Grid.Projection>
            <PlaneProjection x:Name="Projection"/>
        </Grid.Projection>
    </Grid>
</UserControl>

Its my Xaml file  and here is code behind
------------------

 public MusteriListe()
        {
            InitializeComponent();
            var stb1 = new Storyboard { Duration = new Duration(TimeSpan.FromSeconds(1)), SpeedRatio = 3 };

            var daY1 = new DoubleAnimation { From = 0.00, To = 90.00 };
            Storyboard.SetTargetName(daY1, "Projection");
            Storyboard.SetTargetProperty(daY1, new PropertyPath("RotationX"));
            stb1.Children.Add(daY1);
            this.Resources.Add("EndOfPage", stb1);

            var stb = new Storyboard();
            stb.Duration = new Duration(TimeSpan.FromSeconds(1));
            stb.SpeedRatio = 3;

            var daY = new DoubleAnimation { From = -90.00, To = 0.00 };
            Storyboard.SetTargetName(daY, "Projection");
            Storyboard.SetTargetProperty(daY, new PropertyPath("RotationX"));
            stb.Children.Add(daY);
            Resources.Add("StartOfPage", stb);

            dgCustList.Columns.Add(new DataGridTextColumn
            {
                Header = "ID",
                Binding = new Binding("CustomerID")
            });
            dgCustList.Columns.Add(new DataGridTextColumn
            {
                Header = "Müsteri Ad",
                Binding = new Binding("CustomerName")
            });
            dgCustList.Columns.Add(new DataGridTextColumn
            {
                Header = "Müsteri Soyad",
                Binding = new Binding("CustomerSurname")
            });
            dgCustList.Columns.Add(new DataGridTextColumn
            {
                Header = "Müsteri Tel",
                Binding = new Binding("CustomerPhone")
            });
            LoadGrid();
        }
        private void LoadGrid()
        {
            var client = new EczServiceClient();
            client.CustomerInfoCompleted += client_CustomerInfoCompleted;
            client.CustomerInfoAsync();
        }
        void client_CustomerInfoCompleted(object sender, CustomerInfoCompletedEventArgs e)
        {
            dgCustList.ItemsSource = e.Result;
        }

        private void dgCustList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {

            var customer = dgCustList.SelectedItem as CustomerInfo;
            if (customer == null) return;
            var client = new EczServiceClient();
            client.CustomerDetailCompleted += client_CustomerDetailCompleted;
            client.CustomerDetailAsync(customer.CustomerID);
        }
        void client_CustomerDetailCompleted(object sender, CustomerDetailCompletedEventArgs e)
        {
            IN HERE I WANT TO FILL DATAGRID LIKE MASTER GRID ( dgCustDetail.ItemSource = e.Result)
        }
    }
0
Bob LearnedCommented:
What does dgCustList.SelectedItem return?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.