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

RadGridViewCommands.Copy does not work with custom template

1 Answer 134 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brian
Top achievements
Rank 1
Brian asked on 20 Apr 2011, 12:29 AM
The copy command does not seem to work with GridViewDataColumns that have custom CellTemplates defined.  Do I need to override

OnCopyingCellClipboardContent of the GridViewDataColumn?  What is the recomended solution?

 

Example column definition:

 

 

 

<telerik:GridViewDataColumn Header="Counterparty" UniqueName="CounterParty">

 

 

 

 

<telerik:GridViewDataColumn.CellTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<TextBlock Text="{Binding Path=ItemSelectedCounterParty.Name}" TextWrapping="Wrap"/>

 

 

 

 

</DataTemplate>

 

 

 

 

</telerik:GridViewDataColumn.CellTemplate>

 

 

 

 

<telerik:GridViewDataColumn.CellEditTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<ComboBox ItemsSource="{Binding ItemCounterParties}"

 

 

 

SelectedItem="{Binding ItemSelectedCounterParty, Mode=TwoWay}"

 

 

 

DisplayMemberPath="Name"

 

 

 

SelectedValuePath="ConterpartyId"/>

 

 

 

 

</DataTemplate>

 

 

 

 

</telerik:GridViewDataColumn.CellEditTemplate>

 

 

 

 

</telerik:GridViewDataColumn>

Copy command:

 

 

 

 

var copyCommand = RadGridViewCommands.Copy as RoutedUICommand;

 

 

copyCommand.Execute(

 

 

null, this.radGridView);


 

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 20 Apr 2011, 07:24 AM

Hello Brian,

Could you please try to set DataMemeberBinding to your property ("{Binding Path=ItemSelectedCounterParty.Name}") ? 



Best wishes,
Milan
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
Brian
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or