Asp.net - Edit Excel File On Fileserver From Gridview?

Apr 4, 2012

I have a requirement to allow users to browse directories on our file server, and allow the users to navigate to an excel file open it, potentially update it and save it. I have it working. I have 2 gridviews - the first binds to an array of DirectoryInfo and the second binds to an array of FileInfo. I render the name of the file as a link in the grid, like this:

a href='file:///<%# Eval("FullName") %>' target="_blank" >'<%# Eval("Name") %>'

When the link is clicked, the excel file is opened within a browser. In order to save, it seems they have to do 'save as...' and it's confusing. Here is where my questions are. What's the difference between opening an excel file within a browser, vs. opening it with excel? Can I have a link to the file in my grid as above, but cause it to open using the Excel application instead of the browser? Does it matter that the excel files are on a file server? I think my users would be more comfortable editing the file within Excel - not in the browser. How can I accomplish this?

View 1 Replies


ADVERTISEMENT

Asp.net - Edit And Delete A Text File's Row On GridView?

Apr 7, 2012

I have a gridview that contains value of every rows read from a text file. What I want to do is, edit and delete the selected row on the gridview. I already have the code to show every row on the textfile:

[code]...

What I am going to ask is, how do I get the index of selected row return and fill the value to the textbox then update it to the textfile?

View 2 Replies

Open - Edit - Read Excel File Columns?

Sep 23, 2009

How do I open, edit, read excel columns in vb.net? Like, for example, I want to know the values of column B up to the cell that it contains values.

View 1 Replies

Edit The Rows And Columns Of An Excel File Using Vb 2010 Express?

Apr 6, 2012

I want to edit the rows and columns of an excel file using vb 2010 express. NOTE : I dont want to open .exl file but want my program to read and edit them according to user. PS : I want to edit them according to cell number.

View 6 Replies

Protect Excel Workbook - Don't Want The User To Edit Anything Inside The File?

Mar 5, 2009

I'm currently generating some excel files using vb.net (2008). I want to protect the workbook or sheet inside, so that the user cannot edit anything within the file.I tried some options from MSDN but no luck and some other forums but no luck.The following is my last few lines of code in the program.

Code:
ExcelReport = New Excel.ApplicationClass
ExcelReport.Workbooks(1).SaveAs(ExcelFileName)

I basically don't want the user to edit anything inside the file. Perhaps a printout is allowed.

View 1 Replies

Asp.net - Export Gridview To Excel File?

Nov 11, 2011

i have this code it keeps giving me error

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim response As HttpResponse = HttpContext.Current.Response()
response.Clear()
response.AddHeader("content-disposition", "attachment;filename=XXXXXX.xls")

[Code]....

View 2 Replies

Export Data From Gridview To An Existing Excel File?

Apr 7, 2012

I need to save the results of each search that I run on my database, into an excel file. So it is an iterative process where the new search results are added on as new rows to the excel file in each export. I am running the following code which works perfectly fine but for the fact that each export is saved to a newly created excel file.[code]...

View 1 Replies

Enumerate The Mapped Folders On A Fileserver?

Oct 24, 2011

How to enumerate the mapped folders on a fileserver?

View 4 Replies

Asp.net - Export Gridview To Excel Without The Gridview Formatting VB

Sep 23, 2011

I am able to export a gridview to excel, my problem is that I cannot figure out how to remove the formatting from coming over from the girdview. Here is the code I am using to export the gridview: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code]....

View 1 Replies

Asp.net - Edit Gridview Cell Value Based On It's Value?

Aug 20, 2011

I'm displaying a table in a Gridview. Some fields contain 0 and 1, but mean Yes and No. When displaying the table in a Gridview I would like to edit the 0's and 1's to show Yes or No.

<asp:BoundField HeaderText="Gearchiveerd?" InsertVisible="false" DataField="BestellingGearchiveerd" SortExpression="BestellingGearchiveerd">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />

[code]....

View 2 Replies

Asp.net - Gridview Edit Not Updating, Even Though There Are No Errors

Mar 18, 2011

For some reason, when i click edit on my gridview and change a value, and hit update, it does not update the database or the gridview, and it shows no error

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id"
DataSourceID="SqlDataSource1" OnRowDataBound="GridView1_RowDataBound" AllowSorting="True" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" ShowFooter="True" style="font-size: 10pt">
<Columns>

[Code]...

View 1 Replies

Add Textboxes To Gridview Cell On Edit Select?

Sep 23, 2011

I could really use some help on this. I have been searching for a solution on the web but haven't been able to find much help.I need to add textboxes to a gridview edit cell, based on the number of rows of text in one of the cells. I have coded the capture of the number of textboxes I need to add.

But I am not sure which Gridview event to add the code, when going into edit mode, to run the loop that will insert additional Textboxes in a specific column of the row selected to edit.

The user sees colA that has text with line vbCRLF's embedded say:

"This is sample text."

"Line2"

"Line3"

My code reads three Carriage Return, Line feeds. So when the user goes into Edit mode I want to provide one text box for each line or more accurately, add two more as one will already exist.

View 1 Replies

Edit The Column Names Of The GridView Control?

Jul 6, 2009

How do i edit the column header of the GridView control on a web form? I have added a Table to DataSource as:

Me.gvSearchBrandList.DataSource = ds.Tables(0)

in here "gvSearchBrandList" GridView control But the GridView control display the column headers of the Table in the database. But how do i edit those column name in the GridView?

View 1 Replies

Getting ID Of A Control From Gridview Edit Mode To Be Used By Javascript?

Jun 8, 2011

Basically what needs to happen is when the user clicks edit onto the gridview and clicks on a certain textbox a javascript calendar popups up and the user picks a date.So far, I can set it statically and the calendar works for that one row, but not the other rows since the ID changes.My ASP Code (id of textbox has been set to txtStartDate):

<asp:TemplateField SortExpression="StartDate" HeaderText="Start Date">
<EditItemTemplate>
<asp:TextBox ID="txtStartDate" onClick="ddlchange()" Runat="server" Text='<%#Bind("StartDate")%>'>

[code]....

This works, for one textbox. It does not work for other since 'ct102' changes with every row.

View 1 Replies

How To Edit GridView Inside Of Modal Popup

Dec 1, 2010

I have a gridview that appears in a modal popup that is generated dynamically and is bound to a dynamically generated SqlDataSource. I did this to hopefully take advantage of the gridview's automatic editing capabilities. My problem is that when the edit button is clicked the modalpopup closes due to a full postback in spite of the fact that my gridview is in an update panel. I looked at solutions here and here but neither fixed the problem. I've also tried every combination under the sun regarding the positioning of the ModalPopupExtender in relation to the update panel etc, and have tried changing UpdateMode to conditional as well.

Markup:
<span class="none"><asp:Button ID="btnDummy" runat="server" Text="Dummy" /></span>
<ajax:ModalPopupExtender ID="mpLabel" runat="server" TargetControlID="btnDummy" BackgroundCssClass="modalBackground" PopupControlID="pnlLabels"></ajax:ModalPopupExtender>
<asp:Panel ID="pnlLabels" DefaultButton="btnOk" Style="display:none;" runat="server">
<div style="background-color:#fff;border:1px solid black;padding:7px;">
[Code] .....

View 3 Replies

Redirect To Another Url When Edit (option In Gridview) Is Clicked?

Feb 23, 2011

Im using Visual Studio 2008, i have a gridview which gets data from an SQL table. I have added the Edit option which is part of gridview.

The data has a primary key set.

How do i redirect to another URL when the edit option is clicked.

This action should also assign the primary key as a URL Parameter, causing only that specific record to show on the Edit page.

I have gone through this article: Button field in Gridview.

View 4 Replies

Asp.net - Which Gridview Event To Use To Add Items To The Dropdownlist Used In The Edit Template

Oct 7, 2010

I would like to show different values in a dropdownlist, while editing a gridview, depending on which user is logged in. For example...

The officer would see "Approved by Officer" status.
The director would see "Approved by Director" status

I am trying to add these programatically to a dropdownlist which I have in the edit template of my gridview (approvalsGrid). Here is my code:

Protected Sub ApprovalsGrid_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles ApprovalsGrid.RowUpdating
Dim ApprovalEditDD As DropDownList = CType(ApprovalsGrid.Rows(ApprovalsGrid.EditIndex).FindControl("ApprovalEdit"), DropDownList)

[code]....

I do not get any errors. But get an empty dropdown with no items. Am I using the correct event?

View 2 Replies

Data Gridview - Edit Selected Record In Datagrid

Jun 15, 2011

i have a problem with my data gridview i want to edit selected record in datagrid but i am facing some problem here is the code

[Code]...

View 3 Replies

Asp.net - Re-edit This Query To Delete Whole Record From Table1 Using Username From Gridview Cell 4?

Dec 15, 2010

can any one re-edit this query to delete whole record from table1 using username from gridview cell 4 ... ?

Imports System.Data.SqlClient
Dim con As New SqlConnection
Dim cmd As New SqlCommand

[code]....

View 2 Replies

Edit Excel Spreadsheet With My Software?

Jul 29, 2009

I am programming this application right now that will more or less enter data into an excel spreadsheet's cells. This is my own program, it is not using Excel to write this program or function. I just wanted to clear that up.

What would be the easiest way for me to take a .xls file with my program and write values to cells in the file (and open up excel)?

View 2 Replies

Read / Edit Excel Cells Into Textboxes?

Dec 20, 2009

I need to be able to take numbers from multiple textboxes and input them into certain cells in Excel. Also need to do the opposite (Read numbers from Excel and put them into textboxes.)

View 2 Replies

Show ,edit, MS Excel Sheet In VB 2005?

Jul 26, 2011

how to show ,edit, MS excel sheet in Visual Basic 2005?

View 3 Replies

Using VBA To Edit Microsoft Excel Cell Text?

Aug 12, 2009

Every week I generate a CSV report that adds an extra space to the beginning of my date column. Because of the extra space, Excel recognizes the date as text and will not format the information as a date. I have tried the Right() function but once Excel recognizes the date as text, it will not convert to a date. Can I programmatically address this issue in VBA and how?

View 1 Replies

Add,edit And Delete Information In Daatgridview,look Like Microsoft Excel?

Mar 24, 2010

How to do if i want to add,edit and delete information in daatgridview,look like Microsoft excel

View 14 Replies

Edit Excel Document And Save As Option Error

Feb 4, 2012

I was trying to edit a excel document and save under different name and my coding for this is as follows.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Open
Dim MyExcel As New Excel.Application
MyExcel.Workbooks.Open("C:\Test\WalkAir.xlsx")
'Extract
MyExcel.Sheets("sheet1").Activate()
[Code] .....

While debugging the code it resulting with me an error message as Public member 'SaveAs' on type 'ApplicationClass' not found.

View 2 Replies

Launch An Excel Document In Windows, Edit It And Get The Application To Ask To Save It?

Nov 1, 2010

I can launch Excel with the document I want using VB.Net 2010:

Dim p As New System.Diagnostics.Process
p.StartInfo.FileName = "c: empmyfile.xlsx"
p.Start()

Excel starts OK with the file opened. I edit the file, but when I close it down, Excel doesn't ask if I want to save changes. So it closes and loses my edits.

If I do the same with a text file:

Dim p As New System.Diagnostics.Process
p.StartInfo.FileName = "c: empmyfile.txt"
p.Start()

It opens (in Notepad++), I edit it and close it, and Notepad++ asks if I want to save changes.

I've now tried similar code with a Word document - and that's OK. Also with an OpenOffice Sheet document and that works as well.

This behaviour is happening in Windows 7 with Excel 2010. It works as expected in Windows XP with Excel 2007.

What am I doing wrong with Excel? Is it me?

View 2 Replies

Export A GridView To Excel?

Mar 30, 2009

I would like to export a GridView to excel, which is easy enough. But above the grid, in Excel, I would like some other information for identification. Can I somehow export things other than gridviews while then putting in the gridview below?

Edit:For some reason when the GridView1 is visible and I try to export, the entire page exports and not just the gridview. Not sure why!

Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExport.Click
'Create a StringWriter and HtmlTextWriter
Dim sw As System.IO.StringWriter = New System.IO.StringWriter()[code]....

View 5 Replies

Asp.net - Export Excel Spreadsheet To Gridview?

Mar 19, 2012

i have an Excel spreadsheet which I have exported to a Gridview. In my code the table name has to be declared i.e its the name of the worksheet. How can i export excel and select which table i want without hardcoding the table name. i have many worksheets and want to the user to select which table he wants from one workbook.
I am using vb and have a web form.

View 1 Replies

C# - Export A Gridview Into An Excel Spreadsheet?

Sep 10, 2009

What is the best way to export a gridview into an Excel spreadsheet? This seems easy except that my Gridview doesn't have an export attribute.

View 8 Replies

Export Gridview To Excel Error?

Dec 9, 2010

i tried the code below to make the export to excel, but not working correctly i used this thread link text

HtmlForm form = new HtmlForm();
string attachment = "attachment; filename=Patients.xls";
Response.ClearContent();

[Code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved