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

filtering not working

3 Answers 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
T
Top achievements
Rank 1
T asked on 18 Sep 2008, 05:25 PM
I have placed a grid on a page and set the allowfilteringbycolumn to true.  Yet each time I click the icon, I do not get the filter criterion list, nor does it filter.  I have read every article in the knowledge base that I felt was pertinent to no avail.  Any suggestions?

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="RadGrid1">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="RadGrid1" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</telerik:RadAjaxManagerProxy>

<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Office2007" CssClass="RadGrid"

AllowFilteringByColumn="true" AllowSorting="True" Width="100%" AutoGenerateColumns="False"

AllowPaging="true" PageSize="10" OnNeedDataSource="RadGrid1_NeedDataSource">

<PagerStyle Mode="NextPrevAndNumeric" />

<MasterTableView AllowFilteringByColumn="true" AutoGenerateColumns="false">

<Columns>

<telerik:GridTemplateColumn AllowFiltering="false">

<ItemTemplate>

<asp:Image runat="server" Width="60px" ImageUrl='<%#Convert.ToString(DataBinder.Eval(Container, "DataItem.Thumbnail"))%>'

Height="50px"></asp:Image>

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridBoundColumn DataField="StockNumber" SortExpression="StockNumber"

UniqueName="StockNumber" HeaderText="Stock#">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="VIN" UniqueName="VIN" SortExpression="VIN"

HeaderText="VIN">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Year" UniqueName="Year" SortExpression="Year"

HeaderText="Year">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Make" UniqueName="Make" HeaderText="Make" SortExpression="Make" FilterListOptions="AllowAllFilters" CurrentFilterFunction="contains">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Model" UniqueName="Model" HeaderText="Model" SortExpression="Model">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Trim" UniqueName="Trim" HeaderText="Trim" SortExpression="Trim">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="ExteriorColor" UniqueName="ExteriorColor" HeaderText="Color" SortExpression="ExteriorColor">

</telerik:GridBoundColumn>

<telerik:GridTemplateColumn HeaderText="New/Used" ItemStyle-HorizontalAlign="center" DataField="IsUsed" UniqueName="IsUsed" SortExpression="IsUsed">

<ItemTemplate>

<asp:Label runat="server" Text='<%# IsUsed(Convert.ToString(DataBinder.Eval(Container, "DataItem.IsUsed"))) %>'>

</asp:Label>

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridBoundColumn ColumnEditorID="Miles" DataField="Miles" UniqueName="Miles" HeaderText="Miles" SortExpression="Miles">

</telerik:GridBoundColumn>

<telerik:GridTemplateColumn HeaderText="Price" ItemStyle-HorizontalAlign="right" DataField="DisplayPrice" UniqueName="DisplayPrice" SortExpression="DisplayPrice">

<ItemTemplate>

<asp:Label runat="server" Text='<%# FormatMoney(Convert.ToString(DataBinder.Eval(Container, "DataItem.DisplayPrice"))) %>'>

</asp:Label>

</ItemTemplate>

</telerik:GridTemplateColumn>

</Columns>

</MasterTableView>

</telerik:RadGrid>

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Sep 2008, 06:59 AM
Hi T,

Can you try setting the filtering for the Grid in the code behind and see if it is working?

CS:
protected void RadGrid1_PreRender(object sender, EventArgs e)   
    {   
        RadGrid1.MasterTableView.AllowFilteringByColumn = true;   
        RadGrid1.Rebind();   
    }  

Thanks
Shinu.
0
T
Top achievements
Rank 1
answered on 29 Sep 2008, 08:06 PM
Thanks for your reply Shinu,
I have set it.  It still doesn't work.  The filter menu doesn't even appear.  Seems like I am using the very basic application of filtering and yet it doesn't work.

0
Shinu
Top achievements
Rank 2
answered on 30 Sep 2008, 03:51 AM
Hi T,

Filtering should work as expected on using AdvanceDataBinding. Are you exporting the RadGrid? Because filtering menu will not appear after exporting in certain scenarios.
Filtering Menu fails to display after Export from AJAXified Grid

Thanks
Shinu
Tags
Grid
Asked by
T
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
T
Top achievements
Rank 1
Share this question
or