This is a migrated thread and some comments may be shown as answers.

exporttoPDF and exportToCSV GridTemplate Checkbox and hidden label

2 Answers 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rizwan
Top achievements
Rank 1
Rizwan asked on 29 Aug 2012, 08:50 AM

 

hi 
   I am using telerik 2012.2.724.35 and grid is not ajaxified. 

1)    I have a problem with exportToPDF and exportToCSV.  i have template column with checkboxes and when I export to PDF . it display no data but only headers.
2) When I export to CSV the hidden label also display and CSV looks like TrueTrue or FalseFalse ( one for label and one for checkbox) depending if column ticked or not. Please note that label in column is visible false and style to display none.

The grid html and 2 columns are pasted below.

Thanks
Best Regards
Rizwan Bashir

<telerik:RadGrid ID="radGridPermission" runat="server" Skin="Office2007" AutoGenerateColumns="false" AllowPaging="false" AllowSorting="true" Width="99%">
<GroupingSettings CaseSensitive="false" />
<ExportSettings OpenInNewWindow="true" >
<Pdf FontType="Link" PaperSize="A4" />
<Excel Format="Html" />
<Csv ColumnDelimiter="Comma" RowDelimiter="NewLine" />
</ExportSettings>
<ClientSettings>
  <Scrolling AllowScroll="true" FrozenColumnsCount="2" UseStaticHeaders="true"/>
</ClientSettings>
  
<MasterTableView ShowHeader="true" AllowFilteringByColumn="false"
  
<PagerTemplate>
  
<uc1:gridFooter ID="gridFooter" runat="server" />
  
</PagerTemplate>
  
two sample colums are
  
<telerik:GridTemplateColumn HeaderStyle-Width="60px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" DataField="IsActivator" SortExpression="IsActivator" FilterControlWidth="95%">
<ItemTemplate>
  <asp:CheckBox runat="server" ID="chkActivator" Checked="<%# ((SecurityTO)Container.DataItem).IsActivator %>" />
</ItemTemplate>
</telerik:GridTemplateColumn>
  
<telerik:GridTemplateColumn HeaderStyle-Width="60px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" FilterControlWidth="95%" SortExpression="IsQuestionnaireManager" >
<ItemTemplate>
  <asp:CheckBox runat="server" ID="chkQuestionnaireManager" Checked="<%# ((SecurityTO)Container.DataItem).IsQuestionnaireManager %>" >
  <asp:Label runat="server" ID="lblQuestionnaireManager" Text="<%# ((SecurityTO)Container.DataItem).IsQuestionnaireManager %>" style='display:none' Visible="false" />
</ItemTemplate>
</telerik:GridTemplateColumn>

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 03 Sep 2012, 02:21 PM
Hello Rizwan,

Straight onto your questions:

1) You can replace the checkboxes with plain text on the ItemDataBound event.

2) This might be a bug. I will ask our developers to research it. In the meantime, you can remove the hidden control manually in ItemCreated or ItemDataBound events.

Best regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Daniel
Telerik team
answered on 04 Sep 2012, 02:31 PM
Hello Rizwan,

The problem with the hidden controls was confirmed and is already fixed. The upcoming SP2 release will contain this fix. I updated your Telerik points.

Best regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Rizwan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or