Copy and paste from Excel to GridView

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
0
Utf
5/21/2010 2:29:01 PM
dotnet.framework.aspnet 1423 articles. 0 followers. Follow

4 Replies
2379 Views

Similar Articles

[PageSpeed] 49

On May 21, 4:29=A0pm, Luigi <Lu...@discussions.microsoft.com> wrote:
> Hello,
> is it possible to copy and paste values taken from an Excel spreedsheet i=
nto
> 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
0
Alexey
5/21/2010 2:48:58 PM
"Alexey Smirnov" <alexey.smirnov@gmail.com> wrote in message 
news:56ff8a1a-5617-4912-aa43-78ceb47bba76@u7g2000vbq.googlegroups.com...

> 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 

0
Mark
5/21/2010 4:19:35 PM
On May 21, 6:19=A0pm, "Mark Rae [MVP]" <m...@markrae.net> wrote:
> "Alexey Smirnov" <alexey.smir...@gmail.com> wrote in message
>
> news:56ff8a1a-5617-4912-aa43-78ceb47bba76@u7g2000vbq.googlegroups.com...
>
> > 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!
0
Alexey
5/21/2010 10:00:05 PM
On Fri, 21 May 2010 07:29:01 -0700, Luigi
<Luigi@discussions.microsoft.com> 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.
0
Registered
5/27/2010 5:43:15 PM
Reply:

Similar Artilces:

Too Many IF Statements Nesting Error (Excel Formula Loop w/o VBA)
Hello Excel Problem Gurus, First of all, let me thank you in advance. I find it exemplary that you all can devote time to helping others who are having issues with their work. Hopefully one day I can be at a mentor level, and help others too. Hope you can help! I have an issue where I don't know how to write the formula that I need without going over on the nesting. The current formula that I have is as follows: =IF(OR(B7="",J7="",L7="",M7="",N7="",O7="",P7=""),"No Data",IF(V7="Yes",&qu...

How do I create a sample in Excel?
I am trying to create a sample, needing every 20th record out of around 3000 records. Mary, You need a VBA procedure. Sub AAA() Dim RowNdx As Long Dim DestRng As Range Set DestRng = Worksheets("Sheet2").Range("A1") For RowNdx = 1 To 3000 Step 20 Rows(RowNdx).Copy Destination:=DestRng Set DestRng = DestRng(2, 1) Next RowNdx End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Mary" <Mary@discussions.microsoft.com> wrote in message news:ADE0AD7F-B459-41AE-8B2...

Can I copy radio buttons so that the second set is independent of.
I have a group of four radio buttons that all point to one cell. My goal is to create a second set that looks identical to the first but which points to a second cell. This is for a questionaire that will have many questions with the same four answer values. I want to be able to quickly create 100 button groups that will each update a separate cell for scoring of the questionaire. There are optionbuttons on the Control toolbox toolbar and there are optionbuttons on the Forms toolbar. Each has different behaviors. If I had to use lots, I'd use the Forms version. Here's a pos...

Excel 97 Win XP calc problem?
I have a machine running office 97 and Win XP. I have seen posts stating it runs fine, but I don't know how man people use spreadsheets that require a hard calculation: Excel will not force a calculation. i.e. ctrl-alt-f9 does not cause full workbook calculation as required. Meaning cells do not update and it doesn't calculate unless you clic in the cell to edit and hit enter. neither does the "Calc Now" button. Auto or manual calculation mode has no effect. Anybody else have this problem -- Message posted from http://www.ExcelForum.com Make sure that both the SR1 a...

Special Pasting a work book with many sheets and formulas
I have a workbook with many sheets that all have formulas and links to other data. I want to save the workbook as another name with all the worksheets keeping the values only (no links or formulas). Is there a quick way to do this for everysheet without having to special paste every sheet in the workbook. So can I save everysheets data values at workbook level. See this page for a code example http://www.rondebruin.nl/values.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "lex63" <lex63@discussions.microsoft.com> wrote in message news:ED708...

Date display in Excel
Format column of cells as Date, display as mm/dd/yy. Date entered into cell, shows up correctly in the text entry field at the top of the screen, but the data on the worksheet displays as "33747", or similar number. Only happening on one workbook. Try tools|options|View tab|uncheck Formulas. Clark wrote: > > Format column of cells as Date, display as mm/dd/yy. Date > entered into cell, shows up correctly in the text entry > field at the top of the screen, but the data on the > worksheet displays as "33747", or similar number. Only > happening on one...

Cannot open Excel attachment from e-mail when Excel is already ope
This is driving me crazy. If I already have Excel open (with or with out a spreadsheet open) I cannot open an Excel spreadsheet attached to an e-mail. If I close Excel and retry it will open Excel and the spreadsheet. Any ideas? I hate having to close all my open spreadsheets when I want to open a spreadsheet that's been e-mailed to me! One of these usually works with a similar problem starting workbooks by double clicking them in Windows Explorer. Maybe one will work for you and your email problem. Tools|Options|General|Ignore other applications (uncheck it) --- or --- Close E...

Excel and some disappeared sheets
Anybody has the same or similar experiences : - I worked with excel file / closed as usually - new day opened and unfortunatelly some very important sheets disappeared / why ? Don=B4t know - I had about 7-9 sheets just now only 3 ones are there but not so important as another ones - the file has original size / I quickly looked into file by normal text editor only for reading and all relevant data are there, however if I open file by Excel, NO original sheets or data are there. - this file is VERY IMPORTANT for me - why happened ? Don=B4t know since I ask anybody for help Thanks in advan...

office 2000 [excel] cannot open previously OK file. Help
When trying to open a Microsoft Excel Work Sheet that I had accessed modified and saved to only yesterday [Office 2000] a window pops up with: "name.xls cannot be accessed. The file may be resd-only, or you may be trying toaccess a read only location. Or, the server the document is stored on may not be responding." Older files stored on the same mediums ;HD, Flash memory or 3.5in. diskette are accessed with no problem. This is on a network drive? ...

Starting an Office Program (word, excel) in Outlook to send email
I'm taking an Outlook 2002 class. The latest assignment requires I open a Microsoft app in Outlook to send an email. Troubleshooting so far: Have tried to install some addl features from CD, restarted the pc (O/S WINXP) but still get error "Cannot complete action". Get no reason why Outlook cannot perform this action and the HELP hasn't only points me to inserting an object or some variation thereof. My Outlook is configured to use with AOL 9.0. Steps (abbreviated) given in textbook to perform: Actions New mail using Microsoft Office Also tried to perform from Wo...

Copy Toolbar
Can someone tell me if there is a way to copy a toolbar I created on my computer to another computer? Thanks for your help! --- Message posted from http://www.ExcelForum.com/ The toolbar settings are in the *.xlb file. -- Regards, Peo Sjoblom "HelpMe >" <<HelpMe.zmcsh@excelforum-nospam.com> wrote in message news:HelpMe.zmcsh@excelforum-nospam.com... > Can someone tell me if there is a way to copy a toolbar I created on my > computer to another computer? Thanks for your help! > > > --- > Message posted from http://www.ExcelForum.com/ > You...

How do I copy the result of a check box into another check box?
I'm trying to copy the result of a "check box form field" into another check box. For example: if I check (or uncheck) one box in a form, another box later in the protected form will also be checked (or unchecked) , much like the ref + F9 command for the text form field. Is this possible? Thanks. This cannot be done without macros. If your project will allow macros - see http://word.mvps.org/faqs/tblsfldsfms/ExclusiveFmFldChbxs.htm -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> G...

is there a way to program my Excel file to do a loop?
Hi all, If I want B10 to B17 all follow the change of the same number(copy cell), let's say I put it in A1, and C10 follows the change of A2(copy cell), and C11 follows the change of A3(copy cell), and C12 follows the change of A4(copy cell), then I have 4 variables in my calculations: A1, A2, A3, A4. I want to loop each of the variables in a different set, then I hope the whole worksheet will be able to refresh following the change of A1, A2, A3, A4, and then I want to find the very set of A1, A2, A3, A4 that gives the smallest value of D10, how do I program the whole procedure...

Excel 2007 PC damages Mac Excel 2008 Files
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Intel When I open a Mac Excel 2008 file on Excel 2007 and I can work with the file, however when the file is returned to the Mac, it no longer works correctly, leading to a crash as soon as I try to save or eventually it might change the file to look like a bunch of letters and characters. Here is the error report: <br><br>Microsoft Error Reporting log version: 2.0 <br><br>Error Signature: <br> Exception: EXC_BAD_ACCESS <br> Date/Time: 2010-01-15 17:05:56 -0600 <br> Application N...

Excel. I am having a problem with hidden text
As I type text in some cells, it does not always dispaly if it exceeds the cell length. I wish to keep the cell lenghts for the entire document, but do wish for teh text in that particular row to be displayed. How about if you select that cell, then format|cells|alignment tab|check wrap text And with that row selected format|row|autofit SHR77 wrote: > > As I type text in some cells, it does not always dispaly if it exceeds the > cell length. I wish to keep the cell lenghts for the entire document, but do > wish for teh text in that particular row to be displayed. -- Da...

Excel Grid Lines in Outlook Preview Pane
Is there any way to send a spreadsheet to a mail recipient in the body of the message and not have the grid lines show up in the Outlook preview pane when the recipient views the e-mail? If you open the e-mail in Outlook, the grid lines disappear, but in the preview pane they are there. Using Excel and Outlook 2003. Uzytkownik "Kimberly" <Blackrose73@gmail.com> napisal w wiadomosci news:1143658600.180739.308310@v46g2000cwv.googlegroups.com... > Is there any way to send a spreadsheet to a mail recipient in the body > of the message and not have the grid lines show up ...

Copy HYPERLINKS
I have about 200 entries in col a Some of these entries are hyperlinks to other locations I would like a macro to copy ONLY the hyperlinks from Col a to Col b Currently the hyperlinked items are interspaced over the entire col a, I would like to have all the hyperlinks moved to Col B one under the other with no spaces. Thanks Are they =HYPERLINK functions or Inserted hyperlinks?? -- Gary''s Student - gsnu200750 "pcor" wrote: > I have about 200 entries in col a > Some of these entries are hyperlinks to other locations > I would like a macro to copy ONLY the...

Excel error 1706
Whenever I try to start excel on my computer it displays an error message and it shuts itself down, any other program from the office pack works properly, except for the one I mentioned. I reinstalled it and it does the exact same thing. Thanks in advance. ...

Carbon Copy of a message
when ever I get an email from 2 specific users the message always Carbon Copies itself and I cant figure out why. So I end up with 2 of the same messages. Any help would rock Thanx ...

when opening an excel file, 2 files open (one is book1)?
When I click on an excel file, 2 excel documents open up. One document is called Book1 and the other document is the actual document that I want to open. How do I stop this from happening? Brian To prevent Book1 from opening you can append /e to your shortcut for opening Excel. "C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\EXCEL.EXE" /e Alternative to the above............ Go to Start>Settings>Folder>Options>File Types. Scroll down to MS Excel Worksheet. Then if running Win98 OS Edit> select "Open" and Edit. If using WinXP OS you would scroll down to...

Mail merge from excel
I am trying to merge a list of names from excel into publisher. When using the mail merge wizard it wont let me load the names all it says is f1 and f2. what am I doing wrong? any help is greatly appreciated. ...

Excel Jululian 04-24-10
Good morning please help i have a lists of names and i want to separate each in a colum like You Light Up My Life197711 You Light Up My Life (in one colum "A") 1977 (in one colum "B") 1 (in one colum "C") 1 (in one colum "E") regards First many thanks on your reply the text are different in length regards "מיכאל (מיקי) אבידן" wrote: > 'Data' > 'Text to Columns' > 'Next' > mark/un-mark the vertical separators as > shown in the picture > 'Finish' >...

Opening Excel email attachments
When downloading excel files AOL says cannot find suitable program.I then go online to find Excel but only get Uopdates. PC is XP version with Works Suite 2002. A fe months back my dear wife was downloading Excel an got board with waiting and shut down the PC! Any suggestions. Thanks Karl Hi there's no legal way to download Excel!! You have to buy< an Excel version and install it on your PC (or try to open the file with MS Works - but live with the restricted functionality) >-----Original Message----- >When downloading excel files AOL says cannot find >suitable progra...

how do I change date format in the header in Excel XP ?
I need to chage my date format, in the header to Day; Month DD, YYYY ie. Saturday; May 23, 2005. Woudl you please help me out ? Thank you. Regards, Hesam Shakourian Check this out. http://support.microsoft.com/?kbid=213742 but change the format to "dddd, MMMM dd, yyyy" "Hesam" <Hesam@discussions.microsoft.com> wrote in message news:93495F75-4196-4208-9C0D-E800BCAE3A89@microsoft.com... > I need to chage my date format, in the header to Day; Month DD, YYYY > ie. Saturday; May 23, 2005. > > Woudl you please help me out ? > > Thank you. > &g...

modifying and copying multiply selections
Why when I select multiply objects, including text boxes or when I try to select them and then drag to a different locations the program just create a new copy but leaves the old one behind it? It didn't happen when I was working with other versions of Power Point. I think http://www.pptfaq.com/FAQ00882.htm will help. -- Echo [MS PPT MVP] http://www.echosvoice.com What's new in PPT 2010? http://www.echosvoice.com/2010.htm Fixing PowerPoint Annoyances http://tinyurl.com/36grcd PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/32a7nx "Slav" <Sl...