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

Footer Clipboard copy

10 Answers 45 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 15 Nov 2011, 03:27 PM
Hi,

i cant copy the content from the footers into the clipboard. The footer row is always empty in clipboard!

ClipboardCopyMode is "All"

My Style:

<Style x:Key="DataFooter" TargetType="GridView:GridViewFooterCell">
        <Setter Property="Content">
            <Setter.Value>
                <StackPanel>
                    <GridView:AggregateResultsList ItemsSource="{Binding}" VerticalAlignment="Center">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                                    <TextBlock VerticalAlignment="Center" Text="{Binding Caption}" />
                                    <TextBlock VerticalAlignment="Center" Text="{Binding FormattedValue}" />
                                </StackPanel>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Vertical" />
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                    </GridView:AggregateResultsList>
                </StackPanel>
            </Setter.Value>
        </Setter>
    </Style>

Regards,
Thomas


10 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 18 Nov 2011, 03:59 PM
Hello Thomas,

Indeed, you are quite correct. Only the content of the footer (set through Footer property of the column) is copied. We will investigate the issue and consider a way for improving this behavior so that the aggregates are copied as well.
Thank you for your feedback. I have updated your Telerik points accordingly.
 

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Thomas
Top achievements
Rank 1
answered on 24 Nov 2011, 07:42 AM
This is my work arround:

Code Behind:
dataColumn.AggregateFunctions.Add(new SumFunction() { ResultFormatString = "{0:N2}", FunctionName = dataColumn.Header.ToString() });
 
var footerBinding = new Binding(string.Format("AggregateResults[{0}].FormattedValue", dataColumn.Header));
footerBinding.Source = this;
BindingOperations.SetBinding(dataColumn, GridViewColumn.FooterProperty, footerBinding);

Maybe it is for someone usefull....

Regards,
Thomas
0
Maya
Telerik team
answered on 16 Feb 2012, 02:29 PM
Hi Thomas,

The issue has been resolved with our current official release - Q1 2012. I am attaching a sample project so that you can test the functionality.
Let me know in case you find any other related issues.

Regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Thomas
Top achievements
Rank 1
answered on 15 Mar 2012, 10:01 AM
Hi,

i found the same problem in the header.

<telerik:GridViewDataColumn.Header>
   <StackPanel>
      <TextBlock Text="Multiline"></TextBlock>
      <TextBlock Text="Header"></TextBlock>
   </StackPanel>
</telerik:GridViewDataColumn.Header>

In the Clipboard content the Header is "System...StackPanel"

Best Regards,
Thomas
0
Maya
Telerik team
answered on 19 Mar 2012, 10:06 AM
Hello Thomas,

That would be the expected behavior since RadGridView is aware for its data (the items, headers/ footers set through the corresponding properties). However, it does not know about those custom objects that you define in the Header and since every user can place whatever he/ she wants, we cannot create a general way for copying the values for those objects. 
In this case you will need to develop your own custom logic for copy/ paste functionality depending on your specific requirements and settings. 
 

Regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Thomas
Top achievements
Rank 1
answered on 19 Mar 2012, 10:27 AM
I this not the same like in my first post for footer?

Regards,
Thomas
0
Maya
Telerik team
answered on 21 Mar 2012, 09:45 AM
Hello Thomas,

The case with the footer is slightly different as RadGridView is aware of its aggregate results and can read them. If you define a Footer of a column like:

<telerik:GridViewDataColumn.Footer>
                        <TextBlock Text="MyText" />
                    </telerik:GridViewDataColumn.Footer>

The content of the TextBlock will not be copied as well since the grid is not aware of the custom object defined in the footer. 

Greetings,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Thomas
Top achievements
Rank 1
answered on 21 Mar 2012, 09:51 AM
Hello,

okay i understand this. I think it would be great, if the CreateClipBoardCellContent event would be extendet for headercells and footercells...
Is this in on the roadmap?

Regards,
THomas
0
Maya
Telerik team
answered on 21 Mar 2012, 10:29 AM
Hi Thomas,

The idea is that each user can place any content in the headers and footers of the columns.
For example:
1. First case:

<telerik:GridViewDataColumn.Footer>
                        <TextBlock Text="MyText" />
</telerik:GridViewDataColumn.Footer>
2. Second case:
<telerik:GridViewDataColumn.Footer>
                        <Image/>
                        <StackPanel>
                             <TextBlock Text="MyText1" />
                             <TextBlock Text="MyText2" />
                         </StackPanel>
</telerik:GridViewDataColumn.Footer>

What should be copied in both cases ? Generally, in neither case RadGridView is aware of what is placed in the footer. Consequently, it cannot copy the expected content. 

Regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Thomas
Top achievements
Rank 1
answered on 21 Mar 2012, 10:44 AM
Hi,

You are right, but i dont understand why you cant extend the CopyClibboard event.

The current situation is that you get in your first scenario the clipboard content "TextBlock".

If the event would be extended (for header and footer cells) you habe two options:

1. react on the header cell and set the value to the textblock text or something else...
2. dont react. in this case you will see "TextBlock" like it is in the current situation.

I think this event is exactly for this implemented (but only for normal cells)!

Regards,
Thomas

Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Maya
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or