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

Hierarchical radgridview clipboard

3 Answers 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Loic
Top achievements
Rank 1
Loic asked on 17 Oct 2014, 02:44 AM
Hello,

I have a hierarchical radgridview and I would like to be able to copy / paste data from the grid to an excel spreadsheet either from the parent grid either from the child grid.
I use the rowdetailstemplate to load a view containing the child grid. The copy works for the parent grid, but selection is off and copy just does not work for the second grid.

Parent :
 
<telerik:RadGridView  x:Name="RadGridView1"    
                              Grid.Row="2"
                              ItemsSource="{Binding ResultsViewModelList}" AutoGenerateColumns="False"
                              custom:GridViewDataColumnsBehavior.BindableColumns="{Binding ColumnCollection}"
                              SelectionMode="Extended"
                              ScrollViewer.VerticalScrollBarVisibility="Visible"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ColumnWidth="150" GroupRenderMode="Flat"
                              EnableColumnVirtualization="False"
                              ClipboardCopyMode="All"
                              >
            <telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate >
                    <vw:ResultView DataContext="{Binding}"/>
                </DataTemplate>
            </telerik:RadGridView.RowDetailsTemplate>
        </telerik:RadGridView>

child:

<telerik:RadGridView Name="radGridView1" AutoGenerateColumns="True"   ItemsSource="{Binding Path=ItemsList}"
                          ColumnWidth="150" GroupRenderMode="Flat" EnableColumnVirtualization="False" EnableRowVirtualization="False"
                          ClipboardCopyMode="All" SelectionMode="Multiple" SelectionUnit="FullRow">
     </telerik:RadGridView>

3 Answers, 1 is accepted

Sort by
0
Accepted
Boris
Telerik team
answered on 21 Oct 2014, 03:06 PM
Hello Loic,

I am not entirely sure what you mean by: "selection is off and copy just does not work for the second grid". Did you mean that the first item of the child grid is not selected automatically, when it is expanded? If that is so you can set the IsSynchronizedWithCurrentItem property of the child grid to "True". However, if you meant that you cannot select the items manually, you will need to provide us with more details about your case. 

I tried to reproduce the selection issue, however it seams that I am able to select manually the items of the child grid and copy / paste them in a excel file. Could you please examine the attached project and let us know if there are any differences regarding how the selection is made? 

Regards,
Boris Penev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Loic
Top achievements
Rank 1
answered on 22 Oct 2014, 06:57 AM
Concerning the selection, I misinterpret the "multiple" mode, so this is fine.
For the copy / paste, it works as expected in your sample but not in my project. I cannot find why at the moment but I will try to find a solution.

Thanks.
0
Loic
Top achievements
Rank 1
answered on 23 Oct 2014, 02:58 AM
For information,

my source object was wrongly overriding the GetHashCode method and because of that the gridview could not select or copy properly the rows.
Tags
GridView
Asked by
Loic
Top achievements
Rank 1
Answers by
Boris
Telerik team
Loic
Top achievements
Rank 1
Share this question
or