Sticky Filters

3 posts, 1 answers
  1. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 08 Sep 2011 Link to this post

    I am not sure is this is possible or not in the radgrid, but I have a grid and in the grid I have some basic filtering and also have some fileter templates that use a radcombocox to filter by.  Everything works fine but the users want it setup so that when you filter the grid and then navagate away from the page that when you come back to the page it will load with the last filters already set in the grid. 

    When I have done this before I have set the filter up so that it is all done outside the grid and alters the dataset.  Was wondreing if I can do it withing the grid.

    This is one of the filters on the grid
    <telerik:GridBoundColumn SortExpression="ClientName" DataField="ClientName" HeaderText="Client Name">
          <FilterTemplate>
              <telerik:RadComboBox ID="RadComboBoxClientName" DataTextField="ClientName" DataValueField="ClientName" AppendDataBoundItems="true" Width="150px" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ClientName").CurrentFilterValue %>' runat="server" OnClientSelectedIndexChanged="ClientNameIndexChanged" Skin="Office2007">
               </telerik:RadComboBox>
          <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
              <script type="text/javascript">
                       function ClientNameIndexChanged(sender, args) {
                           var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                           if (args.get_item().get_value() == "0") {
                                tableView.filter("ClientName", args.get_item().get_value(), "NoFilter");
                            }
                           else {
                                tableView.filter("ClientName", args.get_item().get_value(), "EqualTo");
                           }
                 }
                </script>
           </telerik:RadScriptBlock>
       </FilterTemplate>
       <ItemStyle VerticalAlign="Top" />
    </telerik:GridBoundColumn>
  2. Answer
    Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 13 Sep 2011 Link to this post

    Hello Eric Klein,

    I think that this online example will help you achieve your goal:
    Persisting Grid Settings 

    Refer to the part which saves and restores the filter expression value inside GridSettingsPersister.cs file.

    Kind regards,
    Pavlina
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 13 Sep 2011 Link to this post

    Ok thanks.
Back to Top