vijay rags

vijay rags

  • NA
  • 68
  • 163.4k

Drill Down in datagrid of silverlight 4

Dec 7 2011 2:48 AM
i need drill down in datagrid itself. that is if i click user id it will display the user information in another row of same grid which is within the grid, like what we have in telerik radgrid allow grouping="true" will enable the radgrid to have a drill down effect. Some thing like that. Is that possible in silverlight 4 datagrid. i tried like this...
 <data:DataGrid x:Name="dgSilverlight" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" AutoGenerateColumns="False"  Foreground="Black"   RowHeight="22"   
            ItemsSource="{Binding}"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" IsReadOnly="True" MinHeight="250"  Margin="5,3,5,0" >
            <data:DataGrid.RowDetailsTemplate >
                <DataTemplate>
                    <StackPanel Background="LightBlue">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="This item has details." />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Here is some data: " />
                            <TextBlock Text="{Binding FirstName}" />
                            <TextBlock Text=" " />
                            <TextBlock Text="{Binding LastName}" />
                        </StackPanel>
                    </StackPanel>

                </DataTemplate>
            </data:DataGrid.RowDetailsTemplate>
        </data:DataGrid>


And in the .cs file i bind the grid with the result list using datacontext. please help


Thanks,
Vijay