PowerTools SPREAD for ASP.NET 8.0J
SortIndicator 列挙体

ソートインジケータの表示/非表示を表します。
構文
'Declaration
 
Public Enum SortIndicator 
   Inherits System.Enum
public enum SortIndicator : System.Enum 
メンバ
メンバ説明
Ascending昇順ソートインジケータを表示します。
Descending降順ソートインジケータを表示します。
Noneソートインジケータを表示しません。
この例では、スプレッドシートにデータを設定し、リストボックスのSelectedIndexChangedイベントで選択に基づいてSortIndicatorを変更します。
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;
	}
}
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).SelectedThen
		FpSpread1.ActiveSheetView.SetColumnSortIndicator(0, FarPoint.Web.Spread.Model.SortIndicator.Descending)
		FpSpread1.ActiveSheetView.AllowSort = True
	End If
End Sub
継承階層

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

参照

FarPoint.Web.Spread.Model 名前空間
SortIndicator プロパティ

開発者の手引き

ソートの概要
ソート

 

 


© 2003-2015, GrapeCity inc. All rights reserved.