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

Disable Filter

2 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Trevor
Top achievements
Rank 1
Trevor asked on 20 Jul 2010, 09:20 PM
Hi, I would like to have a filter for only two out of my three columns. My code is as follows
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" EnableAJAX="true" LoadingPanelID="RadAjaxLoadingPanel1" ClientEvents-OnRequestStart="onRequestStart" >
        <telerik:RadGrid ID="gridUsers" DataSourceID="srcUsers" runat="server" AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true" PageSize="10" AutoGenerateColumns="false">
            <GroupingSettings CaseSensitive="false" />
            <HeaderStyle Font-Bold="true" />
            <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" Visible="true" EnableSEOPaging="true"/>
            <MasterTableView CommandItemDisplay="Top" AllowNaturalSort="false" DataKeyNames="distinguishedName">
                <CommandItemSettings RefreshImageUrl="~/images/refresh_button.gif" ShowExportToWordButton="false" ShowExportToExcelButton="false" ShowExportToCsvButton="true" ShowExportToPdfButton="false" ExportToWordText="" ExportToExcelText="" ExportToCsvtext="" ExportToPdfText="" ExportToWordImageUrl="~/images/export_to_doc.gif" ExportToExcelImageUrl="~/images/export_to_xls.gif" ExportToCsvImageUrl="~/images/export_to_csv.gif" ExportToPdfImageUrl="~/images/export_to_pdf.gif" />
                 
                <Columns>
                    <telerik:GridHyperLinkColumn HeaderText="Edit"  DataNavigateUrlFormatString="EditUser.aspx?user={0}" DataNavigateUrlFields="objectGUID" UniqueName="link" ShowFilterIcon="false"/>
                    <telerik:GridBoundColumn HeaderText="First Name" UniqueName="givenName" DataField="givenName" FilterListOptions="VaryByDataType" FilterImageUrl="~/images/filter_icon.gif" />
                    <telerik:GridBoundColumn HeaderText="Last Name" ItemStyle-Width="100%" HeaderStyle-Width="100%" UniqueName="sn" DataField="sn" FilterListOptions="VaryByDataType" FilterImageUrl="~/images/filter_icon.gif" />
                    <telerik:GridBoundColumn HeaderText="Created" ItemStyle-Wrap="false" UniqueName="whencreated" DataField="whencreated" FilterListOptions="VaryByDataType" FilterImageUrl="~/images/filter_icon.gif" />
                    <telerik:GridBoundColumn HeaderText="distinguishedName" UniqueName="distinguishedName" DataField="distinguishedName" Visible="false" FilterListOptions="VaryByDataType" FilterImageUrl="~/images/filter_icon.gif" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </telerik:RadAjaxPanel>

Where the gridHyperLinkColumn is edit icon that simply opens up a new page for the user to use an edit form. However, there is a filter text box above this column and I would not like it there.

Please help!

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Jul 2010, 05:16 AM
Hello Trevor,

You can disable the filtering option for some of the grid columns by setting their AllowFiltering property to False.

ASPX:
<telerik:GridHyperLinkColumn HeaderText="Edit" DataNavigateUrlFormatString="EditUser.aspx?user={0}"
 DataNavigateUrlFields="CategoryID" UniqueName="link" AllowFiltering="false" />

Thanks,
Princy.
0
Trevor
Top achievements
Rank 1
answered on 21 Jul 2010, 03:29 PM
Thanks Princy! Can't believe I missed that option.
Tags
Grid
Asked by
Trevor
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Trevor
Top achievements
Rank 1
Share this question
or