iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Here we go again...
I am using the Visual Basic sample ProgrammaticExportServerSide. I added an WebGrid1_Export event and using the following code, changed the Column caption from "Address" to "My Address".
With e.Table.Columns .GetNamedItem("Address").Caption = "My Address" End With
The reason, I want to change the header text in the generated output only and want it to be "Address" after the export is complete. So I added a WebGrid1.ExportCompleted event and reveresed the code:
With WebGrid1.RootTable.Columns .GetNamedItem("Address").Caption = "Address" End With
I set breakpoints on each event and ran the program. The ExportCompleted Event never runs. When is this event suppose to execute? And is there a way I can change column headers in the export only without having to go through the above mess?
Also I am Exporting to a TEXT file.
The “OnExport” and “OnExportCompleted” server side event occurs when exporting data from WebGrid is performed. The “ExportGrid()” method that uses in the “ProgrammaticExportServerSide.aspx” sample file will export datasource with current grid’s layout to the other formats.
I suggest you to set the caption of the column before invoking “ExportGrid()” method and reset it afterward.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) WebGrid1.RootTable.Columns.GetNamedItem("Address").Caption = "My Address" Dim file As String = WebGrid1.ExportGrid(New ISNet.WebUI.WebGrid.DynARInfo("excel", Server.MapPath("./TempReports/"), "WebGridToExcel")) ' export grid data WebGrid1.RootTable.Columns.GetNamedItem("Address").Caption = "Address" fileLabel.Text = "File exported to : " & file fileLabel.Text &= "<br/>Click here to open the file : <a href = 'TempReports/WebGridToExcel.xls'>[WebGrid to Excel]</a>" End Sub
Hope this help.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname