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

Hiding ExpandColumn on Export

12 Answers 307 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 2
Steve asked on 16 Jan 2009, 05:27 AM
I've read many posts and nothing seems to work to hide the ExpandColumn when exporting.  I've tried RadGrid1.MasterTableView.GetColumn("ExpandColumn").Visible = false;, I've even loop through the RadGrid1.MasterTableView.Columns collection hiding every single column.  That one blank column still appears.  I'm using the latest version of the control.  Thoughts?

12 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 16 Jan 2009, 01:13 PM
Hi Steve,

Attached to this message, is a small application, which handles a similar task.
I hope it helps.

Sincerely yours,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steve
Top achievements
Rank 2
answered on 16 Jan 2009, 04:57 PM
Unfortunately, that didn't do it.  I actually thought it might because it was something I hadn't tried (i.e. looping the items and using the 'style' attribute).  Don't know if it matters but the additional settings I have on the grid for exporting are ExportOnlyData=true, IgnorePaging=true, OpenInNewWindow=true.  Nothing seems to hide this column.
0
Yavor
Telerik team
answered on 19 Jan 2009, 01:26 PM
Hello Steve,

Attached to this message, is another approach on the matter, heeding the settings which you mentioned.
I hope this helps.

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
MBEN
Top achievements
Rank 2
Veteran
answered on 09 Jan 2012, 08:59 PM
I am unable to hide the expand column on export using the technique shown above.
My export still displays a blank column in the left.
0
Pavlina
Telerik team
answered on 09 Jan 2012, 10:58 PM
Hi,

You can remove the expand column on export  by setting the ExportSettings -> HideStructureColumns boolean property of the grid as explained in the following help article:
http://www.telerik.com/help/aspnet-ajax/grid-export.html.

Greetings,
Pavlina
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
MBEN
Top achievements
Rank 2
Veteran
answered on 09 Jan 2012, 11:33 PM
Hi Pavlina,

I tried setting HideStructureColumns="true" but that does not hide the extra column during export.I have pasted below my aspx for your refernece:


<telerik:RadGrid ID="rgBeneficiary" runat="server" GridLines="Vertical" AllowPaging="true"
                    AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AutoGenerateColumns="False"
                    EnableLinqExpressions="false" AllowSorting="true" AllowAutomaticDeletes="false"
                    Skin="MBen" EnableEmbeddedSkins="false" DataSourceID="_dataSrcBeneficiaries"
                    AllowCustomPaging="false" AllowFilteringByColumn="true" Width="100%" OnPreRender="rgBeneficiary_PreRender"
                    OnItemCommand="rgBeneficiary_ItemCommand" OnItemCreated="rgBeneficiary_ItemCreated"
                    PageSize="15" ImagesPath="../../App_Themes/MBen/Grid">
                    <MasterTableView TableLayout="Fixed" HierarchyDefaultExpanded="false" ClientDataKeyNames="EmployeeID, ParticipantID"
                        HierarchyLoadMode="ServerBind" CommandItemDisplay="Top" DataKeyNames="EmployeeID, ParticipantID"
                        ExpandCollapseColumn-CollapseImageUrl="../../App_Themes/MBen/Grid/Collapse.gif"
                        ExpandCollapseColumn-Display="true" RowIndicatorColumn-Display="false" ExpandCollapseColumn-ExpandImageUrl="../../App_Themes/MBen/Grid/Expand.gif">
                        <CommandItemSettings ShowRefreshButton="false" ShowExportToExcelButton="true" ExportToExcelText=""
                            ExportToCsvText="" ExportToPdfText="" ExportToWordText="" ShowExportToPdfButton="true"
                            ShowExportToWordButton="true" ShowExportToCsvButton="true" ShowAddNewRecordButton="false" />
                        <NoRecordsTemplate>
                            <div style="color: Red; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif;
                                font-weight: bold">
                                <br />
                                Please select a plan to show activity for the specific plan.
                            </div>
                        </NoRecordsTemplate>
                        <CommandItemTemplate>
                            <table width="100%">
                                <td>
                                    <asp:ImageButton ID="btnExpandAll" runat="server" CommandName="ExpandAll" ImageUrl="~/App_Themes/MBen/Grid/Expand.gif"
                                        ToolTip="Expand All" />
                                    <asp:ImageButton ID="btnCollapseAll" runat="server" CommandName="CollapseAll" Visible="False"
                                        ImageUrl="~/App_Themes/MBen/Grid/Collapse.gif" ToolTip="Collapse All" />
                                </td>
                                <td style="float: right">
                                    <asp:ImageButton ID="ExportToExcelButton" runat="server" CommandName="ExportToExcel"
                                        ImageUrl="~/App_Themes/MBen/Grid/ExportToExcel.gif" />
                                    <asp:ImageButton ID="ExportToPdfButton" runat="server" CommandName="ExportToPdf"
                                        ImageUrl="~/App_Themes/MBen/Grid/ExportToPdf.gif" />
                                    <asp:ImageButton ID="ExportToWordButton" runat="server" CommandName="ExportToWord"
                                        ImageUrl="~/App_Themes/MBen/Grid/ExportToWord.gif" />
                                    <asp:ImageButton ID="ExportToCsvButton" runat="server" CommandName="ExportToCsv"
                                        ImageUrl="~/App_Themes/MBen/Grid/ExportToCsv.gif" />
                                </td>
                            </table>
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridBoundColumn DataField="ParticipantID" UniqueName="ParticipantID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EmployeeID" UniqueName="EmployeeID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FullName" UniqueName="FullName" HeaderText="Participant Name"
                                CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"
                                FilterControlWidth="125px" FilterControlToolTip="Input name or part of name to search"
                                HeaderStyle-Width="50%">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EmployeeCode" UniqueName="EmployeeCode" HeaderText="Participant Code"
                                CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"
                                FilterControlWidth="75px" FilterControlToolTip="Input a code to search" HeaderStyle-Width="50%" />
                        </Columns>
                        <DetailTables>
                            <telerik:GridTableView DataKeyNames="BeneficiaryID" DataSourceID="_dataSrcParticipantBeneficiaries"
                                TableLayout="Auto" runat="server" AllowFilteringByColumn="false" ShowFooter="true">
                                <ParentTableRelation>
                                    <telerik:GridRelationFields DetailKeyField="ParticipantID" MasterKeyField="ParticipantID" />
                                </ParentTableRelation>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="BeneficiaryID" UniqueName="BeneficiaryID" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Beneficiary" UniqueName="Beneficiary" HeaderText="Beneficiary Name"
                                        AllowFiltering="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BeneficiaryType" UniqueName="BeneficiaryType"
                                        HeaderText="Beneficiary Type" HeaderStyle-Width="15%">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BeneficiaryRelationship" UniqueName="BeneficiaryRelationship"
                                        HeaderText="Relationship" AllowFiltering="false" HeaderStyle-Width="15%">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BeneficiaryPercent" UniqueName="BeneficiaryPercent"
                                        HeaderText="Beneficiary Percent" AllowFiltering="false" HeaderStyle-Width="18%">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </telerik:GridTableView>
                        </DetailTables>
                        <ExpandCollapseColumn Visible="True">
                        </ExpandCollapseColumn>
                        <RowIndicatorColumn Visible="false">
                        </RowIndicatorColumn>
                    </MasterTableView>
                    <ExportSettings ExportOnlyData="true" IgnorePaging="true" FileName="Export" OpenInNewWindow="true" HideStructureColumns="true">
                        <Pdf PaperSize="A4" PageLeftMargin="5px" PageRightMargin="5px" PageWidth="297mm"
                            PageHeight="210mm" />
                    </ExportSettings>
                </telerik:RadGrid>
0
Pavlina
Telerik team
answered on 10 Jan 2012, 11:48 AM
Hi,

I followed your scenario and prepared a sample project where HideStructureColumns is set to true and ExpandColumn is not visible in the exported file. Please give it a try and let me know what is the difference in your case, so that we can understand why HideStructureColumns does not hide the extra column on your side.

Greetings,
Pavlina
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
MBEN
Top achievements
Rank 2
Veteran
answered on 10 Jan 2012, 09:02 PM
The Telerik version that I was using was one version prior to the latetst internal build version. I am able to hide the first column after updating the version. However, it moves the child grid to the first column as well. I want the child grid to be indented just like it appears on the grid itself so it is more readable for the user.
Could you tell me a way to do that?
0
Pavlina
Telerik team
answered on 13 Jan 2012, 06:08 PM
Hi,

Can you please confirm that the described problem with child grid persists in the project which I sent you in the previous post?

Regards,
Pavlina
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
MBEN
Top achievements
Rank 2
Veteran
answered on 13 Jan 2012, 06:52 PM
Hi Pavlina,

Yes the child grid has the same behavior in the sample project you sent.
0
Pavlina
Telerik team
answered on 13 Jan 2012, 09:41 PM
Hello,

Indeed the described problem persists, however it has been fixed in the latest internal build. Please download it from your account and upgrade to resolve the problem.

Please excuse us for the temporary inconvenience.

Kind regards,
Pavlina
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
Sai Santhosh
Top achievements
Rank 1
answered on 21 Dec 2017, 08:41 AM
Hi, I am using Telerik version 2015.2.826.45. I am still facing the above -mentioned issue. Can you please suggest me what can be the fix for it.
Tags
Grid
Asked by
Steve
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Steve
Top achievements
Rank 2
MBEN
Top achievements
Rank 2
Veteran
Pavlina
Telerik team
Sai Santhosh
Top achievements
Rank 1
Share this question
or