Copy and paste from Excel to GridView

Discussion in 'ASP .Net' started by Luigi, May 21, 2010.

  1. Luigi

    Luigi 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
     
    Luigi, May 21, 2010
    #1
    1. Advertising

  2. On May 21, 4:29 pm, Luigi <> wrote:
    > 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
     
    Alexey Smirnov, May 21, 2010
    #2
    1. Advertising

  3. "Alexey Smirnov" <> wrote in message
    news:...

    > 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...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], May 21, 2010
    #3
  4. On May 21, 6:19 pm, "Mark Rae [MVP]" <> wrote:
    > "Alexey Smirnov" <> wrote in message
    >
    > news:...
    >
    > > 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...
    >
    > --
    > Mark Rae
    > ASP.NET MVPhttp://www.markrae.net


    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!
     
    Alexey Smirnov, May 21, 2010
    #4
  5. Luigi

    MK Guest

    MK, May 27, 2010
    #5
  6. On Fri, 21 May 2010 07:29:01 -0700, Luigi
    <> wrote:

    >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.
     
    Registered User, May 27, 2010
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. zxo102
    Replies:
    3
    Views:
    3,282
    Stuart Corrie
    Aug 9, 2005
  2. KaR
    Replies:
    0
    Views:
    674
  3. NotGiven
    Replies:
    3
    Views:
    368
    Michael D. Kersey
    May 13, 2004
  4. NotGiven
    Replies:
    3
    Views:
    318
    Michael D. Kersey
    May 13, 2004
  5. Replies:
    1
    Views:
    315
Loading...

Share This Page