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

Grid Filter not working

1 Answer 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Atiq Ur Rehman
Top achievements
Rank 1
Atiq Ur Rehman asked on 16 Sep 2008, 12:21 PM
Hi I am using datareader to bind the Grid but its filtering is not working for some reasons. I am using the latest version of Telerik controls and DNN. Here is the code if you need.

<telerik:RadGrid ID="rdActions" runat="server" AllowFilteringByColumn="True"

AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"

GridLines="None" Skin="Sunset" PageSize="20">

<PagerStyle AlwaysVisible="True" Mode="NextPrevNumericAndAdvanced" />

<

MasterTableView DataKeyNames="itemiID" AllowFilteringByColumn="true" ShowFooter="true">

<

RowIndicatorColumn>

<

HeaderStyle Width="20px"></HeaderStyle>

</

RowIndicatorColumn>

<

ExpandCollapseColumn>

<

HeaderStyle Width="20px"></HeaderStyle>

</

ExpandCollapseColumn>

<Columns>

<telerik:GridBoundColumn DataField="dateCol" AutoPostBackOnFilter="true" HeaderText="Date" UniqueName="datCol">

<HeaderStyle Font-Bold="true" />

</telerik:GridBoundColumn>

<telerik:GridTemplateColumn AutoPostBackOnFilter="True" HeaderText="Broker"

UniqueName="brokerCol">

<ItemTemplate>

<a href='<%# gettheURL(DataBinder.Eval(Container, "DataItem.itemiID")) %>'><b>

<%

# formatUser(DataBinder.Eval(Container, "DataItem.BrokeriID")) %>

</b></a>

</ItemTemplate>

<HeaderStyle Font-Bold="True" />

</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn AutoPostBackOnFilter="True" HeaderText="BDE"

UniqueName="bdeCol">

<ItemTemplate>

<asp:Label ID="Label2" runat="server" Text='<%# formatUser(DataBinder.Eval(Container, "DataItem.BDEiID")) %>'>

</asp:Label>

</ItemTemplate>

<HeaderStyle Font-Bold="True" />

</telerik:GridTemplateColumn>

<telerik:GridBoundColumn AutoPostBackOnFilter="True" DataField="VisitType"

HeaderText="Visit Type" UniqueName="visitTypeCol">

<HeaderStyle Font-Bold="True" />

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Status" HeaderText="Status"

UniqueName="statusCol" AutoPostBackOnFilter="True">

<HeaderStyle Font-Bold="True" />

</telerik:GridBoundColumn>

</Columns>

</

MasterTableView>

<

FilterMenu EnableTheming="True">

<

CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

</

FilterMenu>

</telerik:RadGrid>



Protected Sub rdActions_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rdActions.NeedDataSource

Try

Dim BookInfo As New BrokerDirectController

rdActions.DataSource = BookInfo.BDEGetBookVisits(ModuleId, WaaLBL.Text, iIDLBL.Text)

Catch exc As Exception

ProcessModuleLoadException(

Me, exc)

End Try

End Sub


Please help me out with this.

Thanks
Atiq

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 18 Sep 2008, 10:48 AM
Hello Atiq Ur Rehman,

Please try setting the DataField property of the template columns to the corresponding data field and check if it makes any difference.

Additionally, you can review the following articles for information about RadGrid custom filtering:
http://www.telerik.com/help/aspnet-ajax/grdimplementingfilteringfortemplatecolumns.html
http://www.telerik.com/help/aspnet-ajax/grdapplyingdefaultfilteroninitialload.html
http://www.telerik.com/help/aspnet-ajax/grdcustomfilteroptionswithhandling.html

Give it a try and let me know how it goes.

Regards,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Atiq Ur Rehman
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or