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

Paste data from Excel

2 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 15 Oct 2011, 09:06 PM
I am having all sorts of trouble getting this to work...

My RadGridView is setup as follows:

<telerik:RadGridView HorizontalAlignment="Left" Margin="10" Name="rgvBulkEntry" VerticalAlignment="Top" Grid.Column="1" Width="1010" Height="286" MaxColumnWidth="200" MinColumnWidth="75" CanUserFreezeColumns="False" CanUserReorderColumns="False" SelectionMode="Extended" SelectionUnit="Cell" ClipboardPasteMode="AllSelectedCells" >
            <telerik:RadGridView.Columns>
                <telerik:GridViewSelectColumn Header="Select" />
                <telerik:GridViewColumn Header="Col1" />
                <telerik:GridViewColumn Header="Col2" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

From what I was reading, with these few property settings, when data is copied into the clipboard from Excel - it should paste in to the RadGridView without any problems.

But I am not seeing anything show up in the grid.

What am I missing???

2 Answers, 1 is accepted

Sort by
0
Matthew
Top achievements
Rank 1
answered on 16 Oct 2011, 06:45 AM
I got this issue figured out...syntax issue.
0
Frank
Top achievements
Rank 1
answered on 18 Oct 2011, 07:04 PM
Can you let me know what you did? 

I am having the same issue, when I copy and paste from excel 2007, the radgrid would create the cells (i.e. 3 colum by 4 rows) but the cells are empy, nothing are being copied over.

Are there codes in the code behind in the paste or pasting event that I need to do extra coding to get this working?

Here is my xaml:

 

<Grid x:Name="LayoutRoot">

    <telerik:RadGridView HorizontalAlignment="Left"Name="RadGridView1" VerticalAlignment="Top" Height="440" Width="640" SelectionMode="Extended" SelectionUnit="Cell" ClipboardCopyMode="All" ClipboardPasteMode="Cells,AllSelectedCells">

        <telerik:RadGridView.Columns>

            <telerik:GridViewColumn Header="Account" />

            <telerik:GridViewColumn Header="Phone" />

            <telerik:GridViewColumn Header="Address" />

        </telerik:RadGridView.Columns>

    </telerik:RadGridView>

</Grid>

 

Tags
GridView
Asked by
Matthew
Top achievements
Rank 1
Answers by
Matthew
Top achievements
Rank 1
Frank
Top achievements
Rank 1
Share this question
or