Spread for ASP.NET 7.0 Product Documentation
SortIndicator Enumeration
Example  See Also  Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace : SortIndicator Enumeration


Glossary Item Box

Specifies the display of the sort indicator.

Syntax

Visual Basic (Declaration) 
Public Enum SortIndicator 
   Inherits System.Enum
Visual Basic (Usage)Copy Code
Dim instance As SortIndicator
C# 
public enum SortIndicator : System.Enum 

Members

MemberDescription
AscendingDisplays the ascending sort indicator
DescendingDisplays the descending sort indicator
NoneDisplays no sort indicator

Example

This example populates the spreadsheet with data and in the SelectedIndexChanged event of a list box the SortIndicator is changed based on the selection.
C#Copy Code
private void Page_Load(object sender,System.EventArgs e)
{
if(IsPostBack)return;

FpSpread1.ActiveSheetView.ColumnCount=3;
FpSpread1.ActiveSheetView.Columns[2].Width=120;
FpSpread1.ActiveSheetView.SetColumnLabel(0,0,"LName");
FpSpread1.ActiveSheetView.SetColumnLabel(0,1,"FName");
FpSpread1.ActiveSheetView.SetColumnLabel(0,2,"SSN");
FpSpread1.ActiveSheetView.SetValue(0,0,"Adams");
FpSpread1.ActiveSheetView.SetValue(1,0,"Bjorn");
FpSpread1.ActiveSheetView.SetValue(2,0,"Casey");
FpSpread1.ActiveSheetView.SetValue(0,1,"Marie");
FpSpread1.ActiveSheetView.SetValue(1,1,"Johan");
FpSpread1.ActiveSheetView.SetValue(2,1,"Marv");
FpSpread1.ActiveSheetView.SetValue(0,2,"243-65-0987");
FpSpread1.ActiveSheetView.SetValue(1,2,"246-78-6767");
FpSpread1.ActiveSheetView.SetValue(2,2,"223-98-1357");
ListBox1.Items.Add("None");
ListBox1.Items.Add("Ascending");
ListBox1.Items.Add("Descending");
ListBox1.AutoPostBack=true;
}

private void ListBox1_SelectedIndexChanged(object sender,System.EventArgs e)
{
if(ListBox1.Items[0].Selected)
{
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.None);
FpSpread1.ActiveSheetView.AllowSort=true;
}
else if(ListBox1.Items[1].Selected)
{
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.Ascending);
FpSpread1.ActiveSheetView.AllowSort=true;
}
else if(ListBox1.Items[2].Selected)
{
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.Descending);
FpSpread1.ActiveSheetView.AllowSort=true;
}
}
Visual BasicCopy Code
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
If(IsPostBack)Then Return

FpSpread1.ActiveSheetView.ColumnCount=3
FpSpread1.ActiveSheetView.Columns(2).Width=120
FpSpread1.ActiveSheetView.SetColumnLabel(0,0,"LName")
FpSpread1.ActiveSheetView.SetColumnLabel(0,1,"FName")
FpSpread1.ActiveSheetView.SetColumnLabel(0,2,"SSN")
FpSpread1.ActiveSheetView.SetValue(0,0,"Adams")
FpSpread1.ActiveSheetView.SetValue(1,0,"Bjorn")
FpSpread1.ActiveSheetView.SetValue(2,0,"Casey")
FpSpread1.ActiveSheetView.SetValue(0,1,"Marie")
FpSpread1.ActiveSheetView.SetValue(1,1,"Johan")
FpSpread1.ActiveSheetView.SetValue(2,1,"Marv")
FpSpread1.ActiveSheetView.SetValue(0,2,"243-65-0987")
FpSpread1.ActiveSheetView.SetValue(1,2,"246-78-6767")
FpSpread1.ActiveSheetView.SetValue(2,2,"223-98-1357")
ListBox1.Items.Add("None")
ListBox1.Items.Add("Ascending")
ListBox1.Items.Add("Descending")
ListBox1.AutoPostBack=True
End Sub

Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object,ByVal e As System.EventArgs)Handles ListBox1.SelectedIndexChanged
If ListBox1.Items(0).Selected Then
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.None)
FpSpread1.ActiveSheetView.AllowSort=True
ElseIf ListBox1.Items(1).Selected Then
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.Ascending)
FpSpread1.ActiveSheetView.AllowSort=True
ElseIf ListBox1.Items(2).Selected Then
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.Descending)
FpSpread1.ActiveSheetView.AllowSort=True
End If
End Sub

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         FarPoint.Web.Spread.Model.SortIndicator

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.