Spreadsheet - Filter and Sort

  • Filter and Sort
  • Sort range A to Z
    • Sort range A to Z
    • Sort range Z to A
  • Filter
  • Cut
  • Copy
  • Paste
  • Hide
  • Delete
  • Hide
  • Delete
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

The demo exhibits the default Filter and Sort functionalities that the RadSpredsheet control provides. You have the ability to either sort ascending, descending or to clear the sort. As for the filter - you can choose between filtering by value, or condition. If the Filter by condition option is chosen from the Filter menu, you will be able to select from a large list of conditions that suit best your scenario.

In this specific demo, the Filtering is enabled by default, using the Client API of the control. For this purpose the set_filter() function of the Range object is used, passing a true value.

        Sys.Application.add_load(function () {
            var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
            var activeSheet = spreadsheet.get_activeSheet();
            var range = activeSheet.get_range("A2:F11");
            range.set_filter(true);
        });
        

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb"  Inherits="Spreadsheet.Examples.FilterAndSort.DefaultVB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadScriptBlock runat="Server" ID="RadScriptBlock1">
        <script type="text/javascript">
            /* <![CDATA[ */
            Sys.Application.add_load(function () {
                var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
                var activeSheet = spreadsheet.get_activeSheet();
                var range = activeSheet.get_range("A2:F11");
                range.set_filter(true);
            });
            /* ]]> */
        </script>
    </telerik:RadScriptBlock>

    <div class="demo-container no-bg">
        <telerik:RadSpreadsheet runat="server" ID="RadSpreadsheet1">
            <Toolbar>
                <telerik:SpreadsheetToolbarTab Text="Filter and Sort">
                    <telerik:SpreadsheetToolbarGroup>
                        <telerik:SpreadsheetTool Name="Sort" ShowLabel="true" />
                        <telerik:SpreadsheetTool Name="Filter" ShowLabel="true" />
                    </telerik:SpreadsheetToolbarGroup>
                </telerik:SpreadsheetToolbarTab>
            </Toolbar>
        </telerik:RadSpreadsheet>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?