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

PastingCellClipboardContent doesn't fire when trying to copy an empty cell from excel to grid.

8 Answers 171 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mausami
Top achievements
Rank 1
Mausami asked on 13 Jul 2011, 01:20 PM
Hello Telerik team,

I have set the following properties in the gridview excel copy related functionalities.

 

 

SelectionMode="Extended" 
ClipboardCopyMode="All" 
ClipboardPasteMode="Default" 
SelectionUnit="Cell"


My requirement:

I have field in the grid that can be nullable. The CellEditTemple of the field has a dropdown.


<telerik:GridViewDataColumn DataMemberBinding="{Binding ActTypeDesc, Mode=TwoWay}" 
                            Header="ACTTYPE" Width="75" Tag="ActTypeDesc" UniqueName="ActTypeDesc">
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerik:RadComboBox SelectionChanged="radCmbActType_SelectionChanged"
                                                
 Loaded="radCmbActType_Loaded" Tag="ActTypeDesc" Name="radCmbActType"/>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>


Now when I try to paste a non-empty value onto the grid cell I can see that the PastingCellClipboardContent event gets fired.

But when I try to copy a empty cell from the excel and paste onto the grid cell the PastingCellClipboardContent even is not fired.

I wanted to set selected item of the dropdown in this case to null, but the PastingCellClipboardContent doesn;t seem to fire when the cell copied is empty.

I even tried to set the ClipboardPasteMode property to "OverwriteWithEmptyValues" but even this did not seem to help me.

If possible, could you please help me with my requirement.


Many thanks!

Regards,
Mausami

8 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 19 Jul 2011, 09:28 AM
Hello Mausami,

This is expected behavior .If you do not have content to paste - the event will not be fired.

As a workaround I may suggest to explicitly handle the System.Windows.Input.ApplicationCommands.Paste command and this way perform your custom action.

Regards,
Pavel Pavlov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Mausami
Top achievements
Rank 1
answered on 19 Jul 2011, 09:45 AM
Hello Pavel,

Many thanks !

Regards,
Mausami
0
Darrick
Top achievements
Rank 1
answered on 22 Aug 2011, 05:01 PM
Actually, I believe there is an error here.  I ran into the same issue when pasting null/empty cells into the RadGridView.  The Cell data, in cases where it is null/empty, seem to shift.  Meaning, if you look at the GridViewCellClipboardEventArgs GridViewCellInfo property, the GridViewColumn of that property object does not match the corresponding cell type.  In the grid below, if I copy the row (Cells mode as the default), then a paste, I will receive two calls to PastingCellClipBoardConent.  This is great, except if I look at the cell column type for the value of 'True', I get a type of Color.

Integer

Color

Boolean

1

 

True
0
Darrick
Top achievements
Rank 1
answered on 22 Aug 2011, 05:21 PM
It looks like the following will fix the aforementioned issue:
On the RadGridView: ClipboardPasteMode="Cells,SkipHiddenColumns,OverwriteWithEmptyValues"
0
Amit
Top achievements
Rank 1
answered on 03 Nov 2012, 12:39 AM
how can we achieve BELOW FUNCTIONALITY in radgrid?
Is there planned support for the ability to copy 1 cell and paste it to a multiple cell selection?
example:
1
2
3
4
5
we copy the value 1 and select the cells containing values 2 - 5 and execute a paste... the value 1 would be applied to the cells currently containing the values 2 - 5. This will be huge for my application if support is planned for this.

0
Amit
Top achievements
Rank 1
answered on 03 Nov 2012, 08:55 PM
Hi Telerik team,

I am using telerik grid for one of massive data entry project.I would like to copy a two or threecell value and paste it over a bunch of other cell. Is this functionality available out of the box?
 this works fine for me if i select a single cell and cop it on buch of cells but if i selects two or three cell and paste it into buch of cell it;s not work for me.I am using the latest telerik version

Please provide some solution.

0
Mausami
Top achievements
Rank 1
answered on 05 Nov 2012, 04:30 AM

Hello Amit,

Supposed the cells are numbered as given below

1
2
3
4
5
6
7
8
9
10

I select the cells 1,2,3 and copy (Ctrl + C). Then even if I select cells 5,6,7,8,9,10 as the destination cells and paste (Ctrl + V) , the data will get pasted only in cells 5, 6, 7 respectively, since data was copied from only three cells.

 
Regards,
Mausami

0
Amit
Top achievements
Rank 1
answered on 05 Nov 2012, 05:01 PM
Hi Mausami,

Below is my scenario:-

1 2 3 4
5 6 7 8
9 10 11 12

There are three row so if i selected two cells of first row(1,2) and want to copy in place of (5,6) and (9,10) in single hit it's not working it;s just paste in place of (5,6) but i need excel type functionality.. this thing is working for single cell like if i select only 2 and paste it in place of (5,6,9,10) then it's works fine.
But for more than one cell it's not working.

Please suggest some solution.

Thanks,
Amit
Tags
GridView
Asked by
Mausami
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Mausami
Top achievements
Rank 1
Darrick
Top achievements
Rank 1
Amit
Top achievements
Rank 1
Share this question
or