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

RadGrid Filtering

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

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" 
       Skin="Web20" 
       ClickSelectedTab="True" 
       PerTabScrolling="True"  
       MultiPageID="RadMultiPage1" 
       ReorderTabsOnSelect="True" 
       ScrollChildren="True" 
       SelectedIndex="0" 
       ShowBaseLine="True">
       <Tabs>
           <telerik:RadTab runat="server" Text="test1" Selected="True">
           </telerik:RadTab>
           <telerik:RadTab runat="server" Text="test2" >               
           </telerik:RadTab>
           <telerik:RadTab runat="server" Text="test3">
           </telerik:RadTab>
       </Tabs>
   </telerik:RadTabStrip>
   <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" />
               </ExportSettings>
               <ClientSettings>
               <ClientEvents OnRowSelected="OnRowSelecting" />
                   <Selecting AllowRowSelect="True" />
                   <Resizing AllowColumnResize="false" EnableRealTimeResize="false" 
                       ResizeGridOnColumnResize="True" />
               </ClientSettings>
               <AlternatingItemStyle BackColor="White" />
               <GroupHeaderItemStyle HorizontalAlign="Center" />
               <MasterTableView TableLayout="Fixed">
                   <CommandItemSettings ExportToPdfText="Export to Pdf" />
                   <ExpandCollapseColumn>
                      <%-- <HeaderStyle Width="20px" />--%>
                   </ExpandCollapseColumn>
                   <HeaderStyle HorizontalAlign="Center" />
               </MasterTableView>
               <%--<ItemStyle Width="1px" />--%>
           </telerik:RadGrid>
       </telerik:RadPageView>

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
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)


Regards,
Shinu.
Tags
General Discussions
Asked by
nisha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or