Visual Basic (Declaration) | |
---|---|
Public Enum SortIndicator Inherits System.Enum |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As SortIndicator |
C# | |
---|---|
public enum SortIndicator : System.Enum |
Member | Description |
---|---|
Ascending | Displays the ascending sort indicator |
Descending | Displays the descending sort indicator |
None | Displays no sort indicator |
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 Basic | Copy 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 |
System.Object
System.ValueType
System.Enum
FarPoint.Web.Spread.Model.SortIndicator
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
Reference
FarPoint.Web.Spread.Model NamespaceSortIndicator Property
User-Task Documentation
Customizing the Graphical InterfaceCustomizing Sorting of Rows of User Data