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

Paste into Grid from Excel

4 Answers 211 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Iron
Alan asked on 21 Mar 2012, 04:35 PM
I can't seem to paste data from Excel 2010 (only version I have tried) directly into GridView. After pasting, I need to click to edit cell, then that cell only updates. I then have to click into each other cell for it to update. I have tried different options for ClipboardPasteMode - "Default", "AllSelectedCells","AllSelectedCells, Cells","Cells,AllSelectedCells".
I assumed that pasting data from Excel would automatically update the cell (or multiple) value. For now I have comment out the Context Menu because VS2010 debugging won't work.

Many thanks.

Alan
<Page x:Class="ENG_120319.Page1"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
       xmlns:Navigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
       xmlns:telerikg="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
            mc:Ignorable="d"
            d:DesignHeight="416" d:DesignWidth="1203"
            Title="Page1">
    <Grid>
        <TabControl Height="392" HorizontalAlignment="Left" Margin="12,12,0,0" Name="tabControl1" VerticalAlignment="Top" Width="1177">
            <TabItem Header="Support Docs" Name="tabSD">
                <Grid>
                    <telerik:RadGridView ClipboardCopyMode="All" ClipboardPasteMode="AllSelectedCells,Cells" AutoGenerateColumns="False" ItemsSource="{Binding Path=SupDocList}" Margin="6,10,6,6" Name="radGridView1" SelectedItem="{Binding Path=CurrentVCategory, Mode=TwoWay}" SelectionMode="Extended" SelectionUnit="Cell"  ShowGroupPanel="False" FontSize="10" RowHeight="20">
                                                                   
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding SupDocID}" HeaderTextAlignment="Center" Header="Sup Doc ID" Width="70" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding DocCode}" HeaderTextAlignment="Center" Header="Doc List Code" Width="70" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding DocName}" Header="Doc List Name" Width="200"  />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding StartDate}" DataFormatString=" {0:dd/MM/yyyy}" HeaderTextAlignment="Center"  Header="Start Date" Width="100" />
 
                        </telerik:RadGridView.Columns>
                      <!--  <Navigation:RadContextMenu.ContextMenu>
                            <Navigation:RadContextMenu Opened="OnContextMenuOpened">
                                <Navigation:RadMenuItem Command="{Binding AddCommand}" Header="Add a new line" />
                                <Navigation:RadMenuItem Command="{Binding EditCommand}" Header="Save" />
                                <Navigation:RadMenuItem Command="{Binding DeleteCommand}" Header="Delete" />
                            </Navigation:RadContextMenu>
                        </Navigation:RadContextMenu.ContextMenu>-->
                    </telerik:RadGridView>
                </Grid>
            </TabItem>
            <TabItem Header="Handover Docs" Name="tabHO">
            </TabItem>
        </TabControl>
    </Grid>
</Page>


4 Answers, 1 is accepted

Sort by
0
Alan
Top achievements
Rank 1
Iron
answered on 01 Jun 2012, 06:14 AM
Hi,

Just wondering if I could get a response? Thanks. Is it best to create a support ticket?

Al
0
Dimitrina
Telerik team
answered on 05 Jun 2012, 08:59 AM
Hello Alan,

 I have created a sample project where the value is updated once it is pasted. So far I was not able to encounter the behaviour you have described. Would it be possible for you to modify my project so that I can observe the issue?

Regards,
Didie
the Telerik team

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

0
Alan
Top achievements
Rank 1
Iron
answered on 05 Jun 2012, 03:11 PM
Hi Didie,

The only change I made to your solution was to add in
SelectionMode="Extended" SelectionUnit="Cell"

This way I could select the 4x2 range and copy/paste into Excel, modify and then paste it straight back in. Yours worked, mine didn't. The only difference I can see is that your solution is a \window whereas mine is a \page. Would this matter??

Thanks. Al.

 

 

 

0
Dimitrina
Telerik team
answered on 06 Jun 2012, 07:16 AM
Hi Alan,

 I have tested what the behaviour is when the GridView is in a Page and it is the same. How is your data defined? Would it be possible for you to change my project having your data structure?

Regards,
Didie
the Telerik team

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

Tags
GridView
Asked by
Alan
Top achievements
Rank 1
Iron
Answers by
Alan
Top achievements
Rank 1
Iron
Dimitrina
Telerik team
Share this question
or