Spread ASP.NET 6.0 Product Documentation
SortIndicator Enumeration
Example  See Also  Send Feedback
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
privatevoidPage_Load(objectsender,System.EventArgse)
{
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;
}

privatevoidListBox1_SelectedIndexChanged(objectsender,System.EventArgse)
{
if(ListBox1.Items[0].Selected)
{
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.None);
FpSpread1.ActiveSheetView.AllowSort=true;
}
elseif(ListBox1.Items[1].Selected)
{
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.Ascending);
FpSpread1.ActiveSheetView.AllowSort=true;
}
elseif(ListBox1.Items[2].Selected)
{
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.Descending);
FpSpread1.ActiveSheetView.AllowSort=true;
}
}
Visual BasicCopy Code
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load
If(IsPostBack)ThenReturn

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

EndSub

PrivateSubListBox1_SelectedIndexChanged(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesListBox1.SelectedIndexChanged
IfListBox1.Items(0).SelectedThen
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.None)
FpSpread1.ActiveSheetView.AllowSort=True
ElseIfListBox1.Items(1).SelectedThen
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.Ascending)
FpSpread1.ActiveSheetView.AllowSort=True
ElseIfListBox1.Items(2).SelectedThen
FpSpread1.ActiveSheetView.SetColumnSortIndicator(0,FarPoint.Web.Spread.Model.SortIndicator.Descending)
FpSpread1.ActiveSheetView.AllowSort=True
EndIf
EndSub

Inheritance Hierarchy

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

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.