Hiding ExpandColumn on Export

13 posts, 0 answers
  1. Steve
    Steve avatar
    60 posts
    Member since:
    Nov 2006

    Posted 15 Jan 2009 Link to this post

    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?
  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 16 Jan 2009 Link to this post

    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.
  3. Steve
    Steve avatar
    60 posts
    Member since:
    Nov 2006

    Posted 16 Jan 2009 Link to this post

    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.
  4. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 19 Jan 2009 Link to this post

    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.
  5. MBEN
    MBEN avatar
    203 posts
    Member since:
    Nov 2011

    Posted 09 Jan 2012 Link to this post

    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.
  6. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 09 Jan 2012 Link to this post

    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
  7. MBEN
    MBEN avatar
    203 posts
    Member since:
    Nov 2011

    Posted 09 Jan 2012 Link to this post

    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>
  8. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 10 Jan 2012 Link to this post

    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
  9. MBEN
    MBEN avatar
    203 posts
    Member since:
    Nov 2011

    Posted 10 Jan 2012 Link to this post

    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?
  10. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 13 Jan 2012 Link to this post

    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
  11. MBEN
    MBEN avatar
    203 posts
    Member since:
    Nov 2011

    Posted 13 Jan 2012 Link to this post

    Hi Pavlina,

    Yes the child grid has the same behavior in the sample project you sent.
  12. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 13 Jan 2012 Link to this post

    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
  13. Sai Santhosh
    Sai Santhosh avatar
    1 posts
    Member since:
    Dec 2017

    Posted 21 Dec 2017 in reply to Pavlina Link to this post

    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.
Back to Top