GridView Group Dragging in the menu

5 posts, 0 answers
  1. Nick Wood
    Nick Wood avatar
    126 posts
    Member since:
    Feb 2010

    Posted 18 Jan 2011 Link to this post

    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>
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 21 Jan 2011 Link to this post

    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>>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Nick Wood
    Nick Wood avatar
    126 posts
    Member since:
    Feb 2010

    Posted 28 Jan 2011 Link to this post

    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

  5. Nick Wood
    Nick Wood avatar
    126 posts
    Member since:
    Feb 2010

    Posted 28 Jan 2011 Link to this post

    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>
  6. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 02 Feb 2011 Link to this post

    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>>
Back to Top
UI for WPF is Visual Studio 2017 Ready