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

Can't hide Export to Excel or Export to Word buttons

2 Answers 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Laurie
Top achievements
Rank 2
Laurie asked on 02 Jul 2013, 02:55 AM
I'm attaching a jpg of what I see.  I want the export to word and export to excel buttons to go away and for the row that contains them to go away.  Here's the code from my .aspx file:

<telerik:RadGrid ID="rgFields" runat="server" OnNeedDataSource="rgFields_NeedDataSource"
    AutoGenerateColumns="False" CellSpacing="0" GridLines="None" OnItemDataBound="rgFields_ItemDataBound"
    OnItemCreated="rgFields_ItemCreated" MasterTableView-CommandItemDisplay="None">
    <MasterTableView DataKeyNames="FieldID" AllowFilteringByColumn="false" AllowSorting="false" AllowPaging="false" PageSize="1000"
        CommandItemSettings-ShowExportToExcelButton="false" CommandItemSettings-ShowExportToWordButton="false"
        CommandItemSettings-ShowAddNewRecordButton="false" CommandItemSettings-ShowRefreshButton="false">
        <Columns>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="FieldName" HeaderText="Field" UniqueName="FieldName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="FieldType.FieldTypeName" HeaderText="Type" UniqueName="FieldTypeName">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

The only other thing I have going on is I reference a skin in App_Themes that has the following code:

<telerik:RadGrid runat="server" AllowPaging="True" AllowSorting="True"
    AllowFilteringByColumn="true" GridLines="None" AutoGenerateColumns="False" Skin="Default"
    PagerStyle-AlwaysVisible="true" PagerStyle-PageSizeLabelText="Number of entries per page:">
    <MasterTableView CommandItemDisplay="top">
        <CommandItemSettings ShowExportToWordButton="True" ShowExportToExcelButton="True" />
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
    </MasterTableView>
    <HeaderStyle Font-Bold="true" VerticalAlign="top" />
    <ExportSettings ExportOnlyData="True" IgnorePaging="True" OpenInNewWindow="True" />
    <GroupingSettings CaseSensitive="false" />
    <AlternatingItemStyle VerticalAlign="Top" />
    <ItemStyle VerticalAlign="Top" />
</telerik:RadGrid>

I'm guessing that this might be messing me up, but I can't figure out how/why.  I'd like to keep the skin, as it works well for 99% of my grids.

Any ideas would be much appreciated.

Thanks!

Laurie

2 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 04 Jul 2013, 02:33 PM
Hi Laurie,

Thank you for contacting us.

As it seems from your code, you are trying to override RadGrid settings "ShowExportToWordButton" and "ShowExportToExcelButton" defined in the theme.

I am assuming that you are applying the theme by setting the page`s Theme property. In that case the settings from the theme override any page settings on the control (due to higher priority of the page`s Theme). 

Overriding theme setting from the control would be possible if you are applying theme as a style sheet theme by setting the page`s StyleSheetTheme property instead of page`s Theme property (as documented in this article).

Please let us know if you need further assistance.


Regards,
Konstantin Dikov
Telerik
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 the blog feed now.
0
Laurie
Top achievements
Rank 2
answered on 05 Jul 2013, 03:17 PM
Worked like a charm.  I had the theme defined in my web.config, and simply changed Theme= to StyleSheetTheme= and, voila, my excel and word icons were gone.

Thanks!
Tags
Grid
Asked by
Laurie
Top achievements
Rank 2
Answers by
Konstantin Dikov
Telerik team
Laurie
Top achievements
Rank 2
Share this question
or