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

GridView Group Dragging in the menu

4 Answers 34 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Nick Wood
Top achievements
Rank 1
Nick Wood asked on 19 Jan 2011, 02:10 AM
Hi There

I have a menu which contains a gridview, I cant seem to drag column headers to the group header though when in that menu. The menu just dissappears. Code for the grid below:

<telerikGridView:RadGridView x:Name="radGridAssets" Grid.Column="0" Grid.Row="0"
                                             Margin="0" ShowGroupPanel="True" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                             ShowInsertRow="False" RowIndicatorVisibility="Collapsed"
                                             AutoGenerateColumns="False"
                                             ItemsSource="{Binding FullAssetList}">
 
            <!--<telerikGridView:RadGridView.GroupDescriptors>
                <telerikData:GroupDescriptor Member="SiteName" />
            </telerikGridView:RadGridView.GroupDescriptors>-->
            <telerikGridView:RadGridView.SortDescriptors>
                <telerikData:SortDescriptor Member="SiteId" SortDirection="Ascending" />
                <telerikData:SortDescriptor Member="OrderByProcessType" SortDirection="Ascending" />
            </telerikGridView:RadGridView.SortDescriptors>
            <telerikGridView:RadGridView.Columns>
                <telerikGridView:GridViewDataColumn Header="" Width="Auto">
                    <telerikGridView:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="chkSelectedAsset" IsChecked="{Binding IsSelected, Mode=TwoWay}"
                                      Unchecked="chkSelectedAsset_Unchecked" Checked="chkSelectedAsset_Checked" />
                        </DataTemplate>
                    </telerikGridView:GridViewDataColumn.CellTemplate>
                </telerikGridView:GridViewDataColumn>
                <telerikGridView:GridViewDataColumn Header="Site" DataMemberBinding="{Binding SiteName}" IsReadOnly="True">
                    <telerikGridView:GridViewDataColumn.GroupHeaderTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" >
                                <TextBlock Text="{Binding Group.Key}" />
                                <Button x:Name="buttAssetGridSelectAll" Margin="5,0,0,0" Content="All" FontSize="10" Tag="{Binding Group}" Click="buttAssetGridSelectAll_Click"  />
                                <Button x:Name="buttAssetGridSelectNone" Content="None" FontSize="10" Tag="{Binding Group}" Click="buttAssetGridSelectNone_Click" />
                            </StackPanel>
                        </DataTemplate>
                    </telerikGridView:GridViewDataColumn.GroupHeaderTemplate>
                </telerikGridView:GridViewDataColumn>
                <telerikGridView:GridViewDataColumn Header="Asset Name" DataMemberBinding="{Binding AssetName}" />
                <telerikGridView:GridViewDataColumn Header="Process" DataMemberBinding="{Binding ProcessType}" />
                <telerikGridView:GridViewDataColumn Header="SiteId" DataMemberBinding="{Binding SiteId}" IsReadOnly="True" IsVisible="False" />
                <telerikGridView:GridViewDataColumn Header="OrderBy" DataMemberBinding="{Binding OrderByProcessType}" IsReadOnly="True" IsVisible="False" />
            </telerikGridView:RadGridView.Columns>
        </telerikGridView:RadGridView>

4 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 21 Jan 2011, 04:35 PM
Hi Nick,

 
Thank you for sending this snippet. I have just tested it with our latest binaries and everything works fine by my side. Can you please check the attached project and let me know how it differs from yours. In addition to this you can open a new support ticket where you can attach a sample project which could help us to investigate the issue and to provide you with an appropriate solution.

Greetings,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Nick Wood
Top achievements
Rank 1
answered on 28 Jan 2011, 06:07 AM
Hi Vanya

Thanks for the demo, but the issue is that the grid is within a RadMenu it the content of a menu item
telerik:RadMenuItem


So as soon as I try to drag, the menu disappears.



Nick

0
Nick Wood
Top achievements
Rank 1
answered on 28 Jan 2011, 06:31 AM
I have actually modified your code from your example with the menu wrapped around the grid. I tried to attach, but cant from the forum here so the code is below:

<Window
    x:Class="WpfApplication56.MainWindow"
    x:Name="Window"
    Title="MainWindow"
    Width="640" Height="468">
  
  
    <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource SampleDataSource}}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
  
        <telerikGridView:RadMenu Grid.Column="0" Grid.Row="0">
            <telerikGridView:RadMenuItem Header="Tester">
                <telerikGridView:RadGridView x:Name="radGridAssets"
                                             Margin="0" ShowGroupPanel="True" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                             ShowInsertRow="False" RowIndicatorVisibility="Collapsed"
                                             AutoGenerateColumns="False"
                                             ItemsSource="{Binding Collection}">
  
                    <telerikGridView:RadGridView.GroupDescriptors>
                        <telerikGridView:GroupDescriptor Member="Property1" />
                    </telerikGridView:RadGridView.GroupDescriptors>
                    <telerikGridView:RadGridView.SortDescriptors>
                        <telerikGridView:SortDescriptor Member="SiteId" SortDirection="Ascending" />
                        <telerikGridView:SortDescriptor Member="OrderByProcessType" SortDirection="Ascending" />
                    </telerikGridView:RadGridView.SortDescriptors>
                    <telerikGridView:RadGridView.Columns>
                        <telerikGridView:GridViewDataColumn Header="" Width="Auto">
                            <telerikGridView:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <CheckBox x:Name="chkSelectedAsset" IsChecked="{Binding IsSelected, Mode=TwoWay}"
                                     
                                      />
                                </DataTemplate>
                            </telerikGridView:GridViewDataColumn.CellTemplate>
                        </telerikGridView:GridViewDataColumn>
                        <telerikGridView:GridViewDataColumn Header="Site" DataMemberBinding="{Binding Property1}" IsReadOnly="True">
                            <telerikGridView:GridViewDataColumn.GroupHeaderTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" >
                                        <TextBlock Text="{Binding Group.Key}" />
                                        <Button x:Name="buttAssetGridSelectAll" Margin="5,0,0,0" Content="All" FontSize="10" Tag="{Binding Group}" />
                                        <Button x:Name="buttAssetGridSelectNone" Content="None" FontSize="10" Tag="{Binding Group}" />
                                    </StackPanel>
                                </DataTemplate>
                            </telerikGridView:GridViewDataColumn.GroupHeaderTemplate>
                        </telerikGridView:GridViewDataColumn>
                        <telerikGridView:GridViewDataColumn Header="Asset Name" DataMemberBinding="{Binding Property2}" />
                        <telerikGridView:GridViewDataColumn Header="Process" DataMemberBinding="{Binding Property3}" />
                        <telerikGridView:GridViewDataColumn Header="SiteId" DataMemberBinding="{Binding Property4}" IsReadOnly="True" IsVisible="False" />
                        <telerikGridView:GridViewDataColumn Header="OrderBy" DataMemberBinding="{Binding Property3}" IsReadOnly="True" IsVisible="False" />
                    </telerikGridView:RadGridView.Columns>
                </telerikGridView:RadGridView>
            </telerikGridView:RadMenuItem>
        </telerikGridView:RadMenu>
  
  
    </Grid>
</Window>
0
Tsvyatko
Telerik team
answered on 02 Feb 2011, 10:59 AM
Hi Nick Wood,

Currently, there is no build in mechanism that will allow the functionality in this scenario. We have spend some time searching for suitable workaround. However, currently there is no available solution.

Please, excuse us for the inconvenience.

Greetings,
Tsvyatko
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
Menu
Asked by
Nick Wood
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Nick Wood
Top achievements
Rank 1
Tsvyatko
Telerik team
Share this question
or