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

RadGrid Filtering

1 Answer 27 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
nisha asked on 12 Aug 2010, 01:24 PM

I have enabled filtering for the radgrid but its not working. I'm not sure what might be the reason for this. Also I want to enable filtering only for a particular column. Below is the  aspx code i'm using. Please let me how what should be modified in order to make the filtering option to work.

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" 
           <telerik:RadTab runat="server" Text="test1" Selected="True">
           <telerik:RadTab runat="server" Text="test2" >               
           <telerik:RadTab runat="server" Text="test3">
   <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
       <telerik:RadPageView ID="RadPageView1" runat="server">
          <br />
           <asp:Button ID="btn_excel_g" runat="server" Text="Export To Excel" 
                   onclick="btn_excel_g_Click" />
           <asp:Button ID="btn_word_g" runat="server" Text="Export To Word" 
                   onclick="btn_word_g_Click" />
           <asp:Button ID="btn_pdf_g" runat="server" Text="Export To Pdf" 
                   onclick="btn_pdf_g_Click" />
           <telerik:RadGrid ID="gp" runat="server" Skin="WebBlue" 
               OnItemCreated="RadGridStyle_ItemCreated" GridLines="None" AlternatingItemStyle-BackColor="White" 
               OnItemDataBound="RadGrid1_ItemDataBound" AllowFilteringByColumn="True" >
               <ExportSettings FileName="Report">
                   <Pdf PageBottomMargin="1px" PageHeaderMargin="1px" PageHeight="10.5in" 
                       PageLeftMargin="1px" PageRightMargin="1px" PageWidth="13in" 
                       PaperSize="Executive" />
               <ClientEvents OnRowSelected="OnRowSelecting" />
                   <Selecting AllowRowSelect="True" />
                   <Resizing AllowColumnResize="false" EnableRealTimeResize="false" 
                       ResizeGridOnColumnResize="True" />
               <AlternatingItemStyle BackColor="White" />
               <GroupHeaderItemStyle HorizontalAlign="Center" />
               <MasterTableView TableLayout="Fixed">
                   <CommandItemSettings ExportToPdfText="Export to Pdf" />
                      <%-- <HeaderStyle Width="20px" />--%>
                   <HeaderStyle HorizontalAlign="Center" />
               <%--<ItemStyle Width="1px" />--%>

1 Answer, 1 is accepted

Sort by
Top achievements
Rank 2
answered on 12 Aug 2010, 02:25 PM
Hello Nisha.

From you code, I can see that you have not attached the NeedDataSource event or used DataSourceID for the grid. I am assuming that you are using Simple data-binding technique through the DataBind() method which can be used in simple scenarios which does not require complex operations like insert/delete/update, grouping, hierarchy relations, etc.

So, in your case I would suggest you to use Advanced Data-binding (using NeedDataSource event) to populate the grid. Here you can find more information about AdvancedDataBinding.
Grid / Advanced Data Binding Demo
Advanced Data-binding (using NeedDataSource event)

General Discussions
Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 2
Share this question