I'm using Version: 2012.1.215.35 and I'm trying to create a grid that has multi-column headers that span 2 columns. I want to be able to export this grid to CSV and I'm running into problems.
Back end code:
Can someone help with this problem?
Thanks,
Katy Maffei
- The column names are missing
- The values are all together without being separated by commas. (e.g. "25 25%")
Here is my front end code:
<
telerik:GridTemplateColumn
ItemStyle-CssClass
=
"rollupItem"
HeaderStyle-CssClass
=
"rgHeader rollupHeader"
UniqueName
=
"TemplateColumn"
>
<
HeaderTemplate
>
<
table
id
=
"ContactTableHeader"
cellspacing
=
"0"
cellpadding
=
"0"
width
=
"100%"
border
=
"0"
>
<
tr
class
=
"rollupTopHeader"
>
<
td
colspan
=
"2"
align
=
"center"
>
<
asp:Label
ID
=
"hasReceived"
runat
=
"server"
Text
=
'Has Received Prior'
></
asp:Label
>
</
td
>
</
tr
>
<
tr
class
=
"rollupBottomHeader"
>
<
td
width
=
"16%"
align
=
"center"
>
<
asp:Label
ID
=
"hasReceivedTreatmentCountLabel"
runat
=
"server"
Text
=
'Count'
></
asp:Label
>
</
td
>
<
td
width
=
"16%"
align
=
"center"
>
<
asp:Label
ID
=
"hasReceivedTreatmentPercentLabel"
runat
=
"server"
Text
=
'Percent'
></
asp:Label
>
</
td
>
</
tr
>
</
table
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
table
id
=
"ContactRelationshipTable"
cellspacing
=
"0"
cellpadding
=
"0"
width
=
"100%"
border
=
"0"
>
<
tr
class
=
"rollupData"
>
<
td
width
=
"16%"
>
<
asp:Label
ID
=
"hasReceivedTreatmentCount"
runat
=
"server"
Text='<%# Eval("HasReceivedTreatmentCount") %>'></
asp:Label
>
</
td
>
<
td
width
=
"16%"
>
<
asp:Label
ID
=
"hasReceivedTreatmentPercent"
runat
=
"server"
Text='<%# Eval("HasReceivedTreatmentPercent") %>'></
asp:Label
>
</
td
>
</
tr
>
</
table
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
Back end code:
protected void ExportToCSVButton_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
try
{
RollupReportRadGrid.ExportSettings.ExportOnlyData = false;
RollupReportRadGrid.MasterTableView.ExportToCSV();
}
catch (Exception ex)
{
GenericException.HandleException(ex);
Response.Redirect("~/GenericError.aspx");
}
}
Can someone help with this problem?
Thanks,
Katy Maffei