We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Excel Export (Unbound Fields)

Thread ID:





107256 Feb 21,2013 04:30 PM UTC Feb 27,2013 10:54 AM UTC ASP.NET Web Forms (Classic) 1
Tags: GridGroupingControl
Dale Norhern
Asked On February 21, 2013 04:30 PM UTC


I have a Grid Grouping Control that has both bound, and unbound columns.  I am setting the values of the unbound columns in the RowDataBound event, and all is well.  Now I have a need to export the entire grid to Excel.  I am using the following code:

Dim excel As New GridExcelExport(Me.GridGroupingControl1, "C:\ReworkCost.xls", ConverterOptionsExt.Visible)
excel.ExportNestedTable = True

I have also tried "ConverterOptionsExt.All".  The problem is that the unbound cells are empty in the Excel Export.  I found a previous post on this subject at http://www.syncfusion.com/support/forums/grid-aspnet/102027 where Syncfusion stated "We can only export the bound columns to the excel/word".  I am hoping that this is incorrect, or has changed since 2011.  What is the point of an export function, if it doesn't work 100%?

I need to export a grid to Excel with all of the data intact (both bound and unbound fields).

Visual Studio 2010
.NET Framework 4.0
Essential Studio
VB.Net Code behind



Ranjithkumar R G [Syncfusion]
Replied On February 27, 2013 10:54 AM UTC

Hi Dale,


Thanks for using Syncfusion products.


We suggest you to inherit the GridExcelExport class and override the CopyStyles method to achieve your requirement. Please refer to the code snippet below.


  Public Class mycustomExport

        Inherits GridExcelExport

        Public Sub New(ByVal ggc As GridGroupingControlByVal fileName As String)


            MyBase.New(ggc, fileName)

        End Sub



        Protected Overrides Sub CopyStyles(ByVal style As GridTableCellStyleInfoByVal rowIdx As IntegerByVal colIdx As Integer)


            Dim range As IRange = Me.Sheet(rowIdx, colIdx)


            If style.TableCellIdentity.DisplayElement.Kind = DisplayElementKind.Record AndAlso style.TableCellIdentity.Column.HeaderText = "TestCurrency" Then

                Dim nTest As Double = 0.0

                nTest = rowIdx + 1

                Dim nPi As Double = nTest * Math.PI


                range.Text = String.Format("{0:C}", nPi)

            End If



        End Sub

    End Class



Sample link: sample.zip


Please let us know if you have any concern.





This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon