SelectionList イベント

名前 | 説明 | |
---|---|---|
![]() | DataBinding | サーバー コントロールがデータ ソースに連結すると発生します。 ( Control から継承されます。) |
![]() | Disposed | サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。 ( Control から継承されます。) |
![]() | Init | サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。 ( Control から継承されます。) |
![]() | ItemDataBind | リスト内の項目がデータにバインドされたときに発生します。 |
![]() | Load | サーバー コントロールが Page オブジェクトに読み込まれると発生します。 ( Control から継承されます。) |
![]() | PreRender | Control オブジェクトの読み込み後、表示を開始する前に発生します。 ( Control から継承されます。) |
![]() | SelectedIndexChanged | ユーザーが SelectionList オブジェクトの選択を変更するたびに発生します。 |
![]() | Unload | サーバー コントロールがメモリからアンロードされると発生します。 ( Control から継承されます。) |

SelectionList クラス
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)

<ValidationPropertyAttribute("Selection")> _ Public Class SelectionList Inherits MobileControl Implements IPostBackDataHandler
[ValidationPropertyAttribute("Selection")] public class SelectionList : MobileControl, IPostBackDataHandler
[ValidationPropertyAttribute(L"Selection")] public ref class SelectionList : public MobileControl, IPostBackDataHandler

SelectionList クラスは、選択された単一項目または複数項目の選択内容を保持します。SelectionList は MobileControl クラスから直接派生し、ItemWeight プロパティなど、改ページ位置の自動修正を扱うプロパティは備えていません。

次のコード例では、SelectionList クラスの DataSource プロパティは、最初にページを読み込むときに作成される値の配列です。SelectType プロパティの設定を変更すると、異なる形式の SelectionList を確認できます。
![]() |
---|
次のコード サンプルはシングルファイル コード モデルを使用しており、分離コード ファイルに直接コピーされた場合は正常に動作しない可能性があります。このコード サンプルは、拡張子が .aspx の空のテキスト ファイルにコピーする必要があります。詳細については、「ASP.NET Web ページのコード モデル」を参照してください。 |
<%@ Page Language="VB" Inherits="System.Web.UI.MobileControls.MobilePage" %> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <script runat="server"> Public Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) If Not IsPostBack Then Label1.Text = "Select an item" ' Create and fill an array list. Dim listValues As New ArrayList() listValues.Add("One") listValues.Add("Two") listValues.Add("Three") ' Bind the array to the list. SelList1.DataSource = listValues SelList1.DataBind() ' Set the SelectType. SelList1.SelectType = ListSelectType.Radio Else If (SelList1.SelectedIndex > -1) Then ' To show the selection, use the Selection property. Label1.Text = "Your selection is " & _ SelList1.Selection.Text ' Or, show the selection by using ' the MobileListItemCollection class. ' Get the index of the selected item Dim idx As Integer = SelList1.SelectedIndex Label2.Text = "You have selected " & _ SelList1.Items(idx).Text ' Insert a copy of the selected item Dim mi As MobileListItem = SelList1.Selection Label3.Text = "The index of your selection is " & _ mi.Index.ToString() SelList1.Items.Insert(idx, _ New MobileListItem(mi.Text + " Copy")) Else Label1.Text = "No items selected" End If End If End Sub </script> <html xmlns="http:'www.w3.org/1999/xhtml" > <body> <mobile:form id="form1" runat="server"> <mobile:Label id="Label1" runat="server" Text="Show a list" /> <mobile:Label id="Label2" runat="server" /> <mobile:Label id="Label3" runat="server" /> <mobile:SelectionList runat="server" id="SelList1" /> <mobile:Command id="Command1" runat="server" Text=" OK " /> </mobile:form> </body> </html>
<%@ Page Language="C#" Inherits="System.Web.UI.MobileControls.MobilePage" %> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <script runat="server"> public void Page_Load(Object sender, EventArgs e) { if (!IsPostBack) { Label1.Text = "Select an item"; // Create and fill an array list. ArrayList listValues = new ArrayList(); listValues.Add("One"); listValues.Add("Two"); listValues.Add("Three"); // Bind the array to the list. SelList1.DataSource = listValues; SelList1.DataBind(); // Set the SelectType. SelList1.SelectType = System.Web.UI.MobileControls.ListSelectType.Radio; } else { if (SelList1.SelectedIndex > -1) { // To show the selection, use the Selection property. Label1.Text = "Your selection is " + SelList1.Selection; // Or, show the selection by using // the MobileListItemCollection class. // Get the index of the selected item int idx = SelList1.SelectedIndex; Label2.Text = "You have selected " + SelList1.Items[idx].Text; // Insert a copy of the selected item MobileListItem mi = SelList1.Selection; Label3.Text = "The index of your selection is " + mi.Index.ToString(); SelList1.Items.Insert(idx, new MobileListItem(mi.Text + " Copy")); } else { Label1.Text = "No items selected"; } } } </script> <html > <body> <mobile:form id="form1" runat="server"> <mobile:Label id="Label1" runat="server" Text="Show a list" /> <mobile:Label id="Label2" runat="server" /> <mobile:Label id="Label3" runat="server" /> <mobile:SelectionList runat="server" id="SelList1" /> <mobile:Command id="Command1" runat="server" Text=" OK " /> </mobile:form> </body> </html>


System.Web.UI.Control
System.Web.UI.MobileControls.MobileControl
System.Web.UI.MobileControls.SelectionList


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SelectionList コンストラクタ
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SelectionList プロパティ



SelectionList メソッド



名前 | 説明 | |
---|---|---|
![]() | System.Web.UI.IPostBackDataHandler.LoadPostData | このメンバの説明については、「IPostBackDataHandler.LoadPostData」を参照してください。 |
![]() | System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent | このメンバの説明については、「IPostBackDataHandler.RaisePostDataChangedEvent」を参照してください。 |

SelectionList メンバ
選択可能な項目のリストを複数の異なる方法でビジュアルに表示します。
SelectionList データ型で公開されるメンバを以下の表に示します。






名前 | 説明 | |
---|---|---|
![]() | DataBinding | サーバー コントロールがデータ ソースに連結すると発生します。(Control から継承されます。) |
![]() | Disposed | サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。(Control から継承されます。) |
![]() | Init | サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。(Control から継承されます。) |
![]() | ItemDataBind | リスト内の項目がデータにバインドされたときに発生します。 |
![]() | Load | サーバー コントロールが Page オブジェクトに読み込まれると発生します。(Control から継承されます。) |
![]() | PreRender | Control オブジェクトの読み込み後、表示を開始する前に発生します。(Control から継承されます。) |
![]() | SelectedIndexChanged | ユーザーが SelectionList オブジェクトの選択を変更するたびに発生します。 |
![]() | Unload | サーバー コントロールがメモリからアンロードされると発生します。(Control から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Web.UI.IPostBackDataHandler.LoadPostData | このメンバの説明については、「IPostBackDataHandler.LoadPostData」を参照してください。 |
![]() | System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent | このメンバの説明については、「IPostBackDataHandler.RaisePostDataChangedEvent」を参照してください。 |

- SelectionListのページへのリンク