Hi Telerik,
I have a Problem With the Export to excel. In my case, I created the multiple radgrids dynamically from Code - behind and add it into the Placeholder. I have enabled the default Export to excel button for all grids. I haven't use any ajax panels, but I use Update panel. When i click the default Export to excel button, all grids are invisible and excel did not generated.
Code:
Dim dset As DataSet
Dim col_count As Integer
For i As Integer = 0 To c - 1
Dim radgrid1 As New Telerik.Web.UI.RadGrid
radgrid1.ID = "RadGrid" & i
radgrid1.ExportSettings.Excel.Format = GridExcelExportFormat.Html
radgrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top
radgrid1.MasterTableView.PageSize = "10"
radgrid1.MasterTableView.CommandItemSettings.ShowExportToExcelButton = True
radgrid1.MasterTableView.DataKeyNames = New String() {"employee_id"}
radgrid1.ExportSettings.ExportOnlyData = True
radgrid1.ExportSettings.FileName = Pub_dset.Tables("tblCount").Rows(i).Item("sub_heading")
radgrid1.MasterTableView.Caption = "Sub Heading - " & Pub_dset.Tables("tblCount").Rows(i).Item("sub_heading")
radgrid1.AutoGenerateColumns = False
radgrid1.ClientSettings.ClientEvents.OnCommand = "onRequestStart('this')"
dset = DAL.details(9, 4, "", "", "", 0, 0, 0, CDate(Now), CDate(Now), CDate(Now), "", "", "", 0, "", "", 0, 0, i, "", 0, "", 0, 0, "", 0, CDate(Now), "tblBind")
col_count = dset.Tables("tblBind").Columns.Count
col_count = dset.Tables("tblBind").Columns.Count
For j As Integer = 0 To dset.Tables("tblBind").Columns.Count - 1
Dim Bcol As New GridBoundColumn
Bcol.DataField = dset.Tables("tblBind").Columns(j).ColumnName
Bcol.UniqueName = dset.Tables("tblBind").Columns(j).ColumnName
Bcol.HeaderText = dset.Tables("tblBind").Columns(j).ColumnName
Bcol.ShowFilterIcon = True
Bcol.AllowFiltering = True
Bcol.AllowSorting = True
Bcol.ItemStyle.Wrap = False
radgrid1.MasterTableView.Columns.Add(Bcol)
If Bcol.UniqueName = "employee_id" Or Bcol.UniqueName = "emp_no" Then
radgrid1.MasterTableView.GetColumn(Bcol.UniqueName).Display = False
End If
If Bcol.DataField = "emp_name" Then
Bcol.HeaderText = "Employee Name"
End If
Next
radgrid1.DataSource = dset.Tables("tblBind")
radgrid1.Rebind()
PlaceHolder1.Controls.Add(radgrid1)
PlaceHolder1.Controls.Add(New LiteralControl("<br><br>"))
Next
Please help me resolve this...
its very urgent...