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

Adding a FilterTemplate to a column, makes my other filters not work

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan Pope
Top achievements
Rank 1
Ryan Pope asked on 10 May 2011, 03:56 PM
Hello,

I currently have a RadGrid that has multiple columns with Auto Generated filters. The last column in the grid is a select column which I do not want a filter at the top of. I tried to fix this by adding an empty <FilterTemplate>&nbsp;</FilterTemplate>. This worked and removed the filter from above the select column, but none of my filters work now. If there a reason why this is happening?

My code is posted below:
<telerik:radgrid runat="server" DataSourceID="dsFindNavCustomers" 
    GridLines="None" ID="grdCustomers" AutoGenerateColumns="False" 
    AllowPaging="True" AllowSorting="True" PageSize="15" 
    AllowFilteringByColumn="True" CellSpacing="0">
    <PagerStyle Mode="Slider" />
    <FilterItemStyle HorizontalAlign="Left" />
    <MasterTableView datasourceid="dsFindNavCustomers"
        nomasterrecordstext="There are no customers matching your filters.">
        <Columns>
            <telerik:GridTemplateColumn DataField="No." HeaderText="Customer No." UniqueName="CustomerNo">
                <ItemTemplate>
                    <asp:Label ID="lblCustomerNo" runat="server" Text='<%# Container.DataItem("No.") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" HorizontalAlign="Left" 
                    Font-Strikeout="False" Font-Underline="False" Width="100px" Wrap="True" />
                <ItemStyle HorizontalAlign="Left" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="Name" HeaderText="Customer Name" FilterControlWidth="120px"
                UniqueName="Name">
                <ItemTemplate>
                    <asp:Label ID="lblCustomerName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                    <asp:Label ID="lblCompanyName" runat="server" 
                        Text='<%# Eval("Company Name") %>' Visible="False"></asp:Label>
                </ItemTemplate>
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" HorizontalAlign="Left"
                    Font-Strikeout="False" Font-Underline="False" Width="200px" Wrap="True" />
                <ItemStyle HorizontalAlign="Left" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="Contact" HeaderText="Contact Name" FilterControlWidth="120px"
                UniqueName="Contact">
                <ItemTemplate>
                    <asp:Label ID="lblContactPersonName" runat="server" 
                        Text='<%# Eval("Contact") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" HorizontalAlign="Left"
                    Font-Strikeout="False" Font-Underline="False" Wrap="True" />
                <ItemStyle HorizontalAlign="Left" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="City" HeaderText="Bill-to City" FilterControlWidth="110px"
                UniqueName="City">
                <ItemTemplate>
                    <asp:Label ID="lblCustomerCity" runat="server" Text='<%# Eval("City") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" HorizontalAlign="Left"
                    Font-Strikeout="False" Font-Underline="False" Width="125px" Wrap="True" />
                <ItemStyle HorizontalAlign="Left" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="State" HeaderText="Bill-to State" FilterControlWidth="50px"
                UniqueName="State">
                <ItemTemplate>
                    <asp:Label ID="lblCustomerState" runat="server" Text='<%# Eval("State") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" HorizontalAlign="Left"
                    Font-Strikeout="False" Font-Underline="False" Width="65px" Wrap="True" />
                <ItemStyle HorizontalAlign="Left" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="select">
                <ItemTemplate>
                    <asp:LinkButton ID="btnSelectCustomer" runat="server" CausesValidation="false" 
                        CommandName="Select" Text="Select"></asp:LinkButton>
                </ItemTemplate>
                <HeaderStyle Width="40px" Font-Bold="True" Font-Italic="False" HorizontalAlign="Left"
                    Font-Overline="False" Font-Strikeout="False" Font-Underline="False" 
                    Wrap="True" />
                <FilterTemplate>
                       
                </FilterTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
    <clientsettings>
        <selecting enabledragtoselectrows="False" />
    </clientsettings>
</telerik:radgrid>

Any help would be greatly appreciated.
Thanks,
Ryan Pope

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 11 May 2011, 11:01 AM
Hello Ryan Pope,

Try setting the AllowFiltering property for the GridTemplateColumn to false and see if helps to disable the filter function in TemplateColumn .
ASPX:
<telerik:GridTemplateColumn UniqueName="select"  AllowFiltering="false">   
                     </telerik:GridTemplateColumn>

Regards,
Pavlina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Ryan Pope
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or