Copy and paste from Excel to GridView

  • Thread starter Thread starter Luigi
  • Start date Start date
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
 
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
 
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...
 
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!
 
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.
 
Back
Top