This is a migrated thread and some comments may be shown as answers.

Two questions : DetailsPresenter rows empty and drag & drop doesnt work

3 Answers 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
fred
Top achievements
Rank 1
fred asked on 22 Jun 2010, 01:14 PM
Hi,

Using the Datagridview to collect datas, I try to create a second gridview filled with the details (the main datagridview contains 6 columns and I want to sum it up to a 2 columns details gridview, with each row on column 1 containing the header of each of the main datagridview, and each row on column 2 containing the datas).

I thought the DetailsPresenter could help me doing that. Am I wrong ?
And By the way, I can display the so called Details Presenter but the drag & drop function doesn't even work. Why ?

Here is my code :

Thanks in advance

<Grid x:Name="LayoutRoot" Theme:StyleManager.Style="Grid_Background_Style">
        <Grid>
               
            <Grid.RowDefinitions>
                <RowDefinition Height="100"/>
                <RowDefinition Height="150"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <Border Theme:StyleManager.Style="Border_MenuBar_Style" Grid.Row="0">
               <!-- MYCODE-->
                            </Border>

            <Border Grid.Row="1" Theme:StyleManager.Style="Grid_Background_Style">
                <Grid>
                    <Grid Theme:StyleManager.Style="Grid_Background_Style">

                        <StormGridView:StormGridView ItemsSource="{Binding Path=Downloads}"  x:Name="QCDetails"
                                   AutoGenerateColumns="False" IsReadOnly="True" ShowGroupPanel="False">
                            <StormGridView:StormGridView.Columns>

                                <StormGridView:StormGridViewColumn Header="Name" HeaderTextAlignment="Center" Width="120" >
                                    <StormGridView:StormGridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <HyperlinkButton Content="{Binding Path=QualityControlName}" Click="HyperlinkButton_Click"></HyperlinkButton>
                                            </StackPanel>
                                        </DataTemplate>
                                    </StormGridView:StormGridViewColumn.CellTemplate>
                                </StormGridView:StormGridViewColumn>

                                <StormGridView:StormGridViewColumn Header="Description" TextAlignment="Center" HeaderTextAlignment="Center" Width="300" >
                                    <StormGridView:StormGridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Path=QualityControlDescription}" TextWrapping="Wrap" TextAlignment="Center" Width="250">
                                                </TextBlock>
                                            </StackPanel>
                                        </DataTemplate>
                                    </StormGridView:StormGridViewColumn.CellTemplate>
                                </StormGridView:StormGridViewColumn>

                                <StormGridView:StormGridViewColumn Header="Type" TextAlignment="Center" HeaderTextAlignment="Center" Width="120">
                                    <StormGridView:StormGridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Path=QualityControlType}" TextAlignment="Center"></TextBlock>
                                            </StackPanel>
                                        </DataTemplate>
                                    </StormGridView:StormGridViewColumn.CellTemplate>
                                </StormGridView:StormGridViewColumn>

                                <StormGridView:StormGridViewColumn Header="Severity" TextAlignment="Center" HeaderTextAlignment="Center" Width="120">
                                    <StormGridView:StormGridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Path=QualityControlSeverity}" TextAlignment="Center"></TextBlock>
                                            </StackPanel>
                                        </DataTemplate>
                                    </StormGridView:StormGridViewColumn.CellTemplate>
                                </StormGridView:StormGridViewColumn>

                                <StormGridView:StormGridViewColumn Header="Synopsis" TextAlignment="Center" HeaderTextAlignment="Center" Width="300" >
                                    <StormGridView:StormGridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Path=QualityControlSynopsis}" TextAlignment="Center" Width="250" TextWrapping="Wrap"></TextBlock>
                                            </StackPanel>
                                        </DataTemplate>
                                    </StormGridView:StormGridViewColumn.CellTemplate>
                                </StormGridView:StormGridViewColumn>

                                <StormGridView:StormGridViewColumn Header="Timecode" TextAlignment="Center" HeaderTextAlignment="Center" Width="120">
                                    <StormGridView:StormGridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBox Text="{Binding Path=QualityControlTimecode}" TextAlignment="Center" IsReadOnly="True"></TextBox>
                                            </StackPanel>
                                        </DataTemplate>
                                    </StormGridView:StormGridViewColumn.CellTemplate>
                                </StormGridView:StormGridViewColumn>

                            </StormGridView:StormGridView.Columns>
                        </StormGridView:StormGridView>
                    </Grid>
                </Grid>
            </Border>
           
            <Border Grid.Row="2" Theme:StyleManager.Style="Grid_Background_Style" HorizontalAlignment="Left">
                <Grid>                       
                    <!-- SELECTED ELEMENT DETAILS -->
                    <StackPanel Orientation="Horizontal">
                       
                        <StackPanel Orientation="Vertical">
                            <dataInput:Label Content="Selected Element" Foreground="White"/>
                        </StackPanel>
                        <StackPanel Orientation="Vertical">                           
                            <StackPanel.Resources>
                                <DataTemplate x:Key="myRowDetailsTemplate">
                                    <TextBlock Text="Selected Element" />
                                </DataTemplate>
                            </StackPanel.Resources>
                            <telerikGridView:RadGridView x:Name="grid" RowDetailsVisibilityMode="Collapsed" RowDetailsTemplate="{StaticResource myRowDetailsTemplate}">
                            </telerikGridView:RadGridView>
                            <GridView:DetailsPresenter x:Name="externalDetailsPresenter"/>
                        </StackPanel> 
                       
                        <!-- MEDIA -->
                        <StackPanel Orientation="Vertical" VerticalAlignment="Bottom">
<!--MY CODE AGAIN -->

                        </StackPanel>

                    </StackPanel>                 
                </Grid>
            </Border>
        </Grid>
    </Grid>

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 22 Jun 2010, 01:39 PM
Hi fred,

It seems that you have not linked the external details presenter. Please, take a look at this help topic and this online example?

Anyway, what is this drag-and-drop function that does not even work. What are you refferring to?

Sincerely yours,
Ross
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
fred
Top achievements
Rank 1
answered on 22 Jun 2010, 03:30 PM
Thank you, it will fit perfectly.

Just one more question, about the example.
I see a special reference in the assemblies.

 xmlns:local="clr-namespace:Telerik.Windows.Examples.GridView.RowDetails"

It seems it won't work without it; and I can't include this special assembly in my code, it would not be "clean".

Tia and Regards
0
Rossen Hristov
Telerik team
answered on 22 Jun 2010, 03:38 PM
Hello fred,

"Telerik.Windows.Examples.GridView.RowDetails" is the namespace of the concrete example. This is not an assembly. You do not need to include the examples assembly in your project. It is just an example.

Best wishes,
Ross
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
fred
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
fred
Top achievements
Rank 1
Share this question
or