Copy and paste from Excel to GridView

L

Luigi

Hello,
is it possible to copy and paste values taken from an Excel spreedsheet into
the grid of a GridView in a ASP.NET page?

Luigi
 
G

Guest

Hello,
is it possible to copy and paste values taken from an Excel spreedsheet into
the grid of a GridView in a ASP.NET page?

Luigi

You mean from a single cell or entire table?

The standard gridview control is a data-bound control for rendering
data. It has no paste function. To copy and paste values from Excel
you can use a separated textbox where you can paste the text, parse
it, update datasource with a new data and refresh gridview after that.
The parsing can be easily done, just loop through each line of text
and split it on the tab character.

Hope this helps
 
M

Mark Rae [MVP]

The standard gridview control

What you say is correct, though there are several 3rd-party controls
available which support this behaviour and, although they are not free of
course, they may be more cost-effective for the OP in the long run due to
the "not re-inventing the wheel" factor...
 
G

Guest

What you say is correct, though there are several 3rd-party controls
available which support this behaviour and, although they are not free of
course, they may be more cost-effective for the OP in the long run due to
the "not re-inventing the wheel" factor...

Yes, I agree why reinvent the wheel if it is already exist... On
another hand, such thing can be easily implemented and might be useful
in a variety of contexts

Cheers!
 
R

Registered User

Hello,
is it possible to copy and paste values taken from an Excel spreedsheet into
the grid of a GridView in a ASP.NET page?
As others have said there are third-party controls that support such
copy-and-paste activity. I have no experience with such controls.

There is probably more going on than the question exposes. I would
consider uploading the file and then bind the data to the control.

regards
A.G.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top