RadGrid for ASP.NET

RadGrid Send comments on this topic.
SortingSettings Property
See Also  Example
Telerik.WebControls Namespace > RadGrid Class : SortingSettings Property


Gets a reference to the GridSortingSettings object that allows you to set the properties of the sorting operation in a Telerik RadGrid control.

  

 

Namespace: Telerik.WebControls
Assembly: RadGrid (in RadGrid.dll)

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property SortingSettings As GridSortingSettings
Visual Basic (Usage)Copy Code
Dim instance As RadGrid
Dim value As GridSortingSettings
 
value = instance.SortingSettings
C# 
public GridSortingSettings SortingSettings {get;}

Return Value

A reference to the GridSortingSettings that allows you to set the properties of the sorting operation in a Telerik RadGrid control.

Example

The following code example demonstrates how to set the SortingSettings property declaratively. It sets the tooltips of the sorting control of the Telerik RadGrid control.
Visual BasicCopy Code
<%@ Page Language="VB" %>

<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <rad:RadGrid
            DataSourceID="SqlDataSource1"
            ID="RadGrid1"
            runat="server"
            AllowSorting="true">
            <SortingSettings SortToolTip="SortToolTip" SortedAscToolTip="SortedAscToolTip" SortedDescToolTip="SortedDescToolTip" />
        </rad:RadGrid>
        <!-- This example uses Microsoft SQL Server and connects -->
        <!-- to the Northwind sample database. Use an ASP.NET -->
        <!-- expression to retrieve the connection string value -->
        <!-- from the Web.config file. -->
        <asp:SqlDataSource
            ID="SqlDataSource1"
            runat="server"
            ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>"
            SelectCommand="SELECT [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
        </asp:SqlDataSource>
    </div>
    
</body>
</html>

Remarks

Use the SortingSettings property to control the settings of the sorting operations in a Telerik RadGrid control. This property is read-only; however, you can set the properties of the GridSortingSettings object it returns. The properties can be set declaratively using one of the following methods:

  • Place an attribute in the opening tag of the Telerik RadGrid control in the form Property-Subproperty, where Subproperty is a property of the GridSortingSettings object (for example, SortingSettings-SortedAscToolTip).
  • Nest a <SortingSettings> element between the opening and closing tags of the Telerik RadGrid control.

The properties can also be set programmatically in the form Property.Subproperty (for example, SortingSettings.SortedAscToolTip). Common settings usually include the tool tips for the sorting controls.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also