File tree 1 file changed +42
-0
lines changed
controls/treelist/functionality
1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -41,3 +41,45 @@ Due to the self-referencing nature of the control, the sorting takes effect "per
41
41
| ** AllowNaturalSort** | Enables or disables the "natural" sort mode where the items are ordered in the way they came from the data source.|
42
42
| ** AllowSorting** | Enables the sorting functionality in RadTreeList.|
43
43
| ** SortExpressions** | SortExpressions collection. Contains the expressions that are applied to the control.|
44
+
45
+
46
+ Example 1: Declarative Approach of setting the SortExpressions
47
+
48
+ ```` ASPX
49
+ <telerik:RadTreeList ID="RadTreeList1" runat="server" DataSourceID="SqlDataSource1" AllowSorting="True" ...>
50
+ <SortExpressions>
51
+ <telerik:TreeListSortExpression FieldName="EmployeeName" SortOrder="Ascending" />
52
+ </SortExpressions>
53
+ </telerik:RadTreeList>
54
+ ````
55
+
56
+ Example 2: Programmatic Approach of setting the SortExpressions
57
+
58
+ ```` C#
59
+ protected void Page_Load (object sender , EventArgs e )
60
+ {
61
+ if (! IsPostBack )
62
+ {
63
+ TreeListSortExpression sortExpr = new TreeListSortExpression ();
64
+ sortExpr .FieldName = " EmployeeName" ;
65
+ sortExpr .SortOrder = TreeListSortOrder .Ascending ;
66
+ RadTreeList1 .SortExpressions .AddSortExpression (sortExpr );
67
+
68
+ RadTreeList1 .Rebind ();
69
+ }
70
+ }
71
+ ````
72
+ ```` VB.NET
73
+ Protected Sub Page_Load(sender As Object , e As EventArgs)
74
+ If Not IsPostBack Then
75
+ Dim sortExpr As New TreeListSortExpression()
76
+ sortExpr.FieldName = "EmployeeName"
77
+ sortExpr.SortOrder = TreeListSortOrder.Ascending
78
+ RadTreeList1.SortExpressions.AddSortExpression(sortExpr)
79
+
80
+ RadTreeList1.Rebind()
81
+ End If
82
+ End Sub
83
+ ````
84
+
85
+
You can’t perform that action at this time.
0 commit comments