CommandField.SelectText プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As CommandField Dim value As String value = instance.SelectText instance.SelectText = value
[LocalizableAttribute(true)] public: virtual property String^ SelectText { String^ get (); void set (String^ value); }
/** @property */ public String get_SelectText () /** @property */ public void set_SelectText (String value)
CommandField の Select ボタンのキャプション。既定値は "選択" です。

CommandField フィールドの ButtonType プロパティが ButtonType.Button または ButtonType.Link に設定されている場合は、SelectText プロパティを使用して、Select ボタンに表示するテキストを指定します。
![]() |
---|
Select ボタンにテキストを表示する代わりに、ButtonType プロパティを ButtonType.Image に設定し、次に SelectImageUrl プロパティを設定して、イメージを表示することもできます。 |
このプロパティを設定している場合、デザイナ ツールを使用して、その値を自動的にリソース ファイルに保存できます。詳細については、LocalizableAttribute、ASP.NET のグローバリゼーションおよびローカリゼーション の各トピックを参照してください。

SelectText プロパティを使用して、GridView コントロールの CommandField フィールドに表示される Select ボタンのカスタム キャプションを指定するコード例を次に示します。
<%@ Page language="VB" AutoEventWireup="False" %> <script runat="server"> Sub CustomersGridView_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CustomersGridView.SelectedIndexChanged ' Retrieve the company name from the appropriate cell. Dim companyName As String = CustomersGridView.SelectedRow.Cells(2).Text ' Display company name selected by the user. Message.Text = "You selected " & companyName & "." End Sub </script> <html> <body> <form runat="server"> <h3>CommandField Example</h3> <asp:Label id="Message" forecolor="Red" runat="server"/> <asp:gridview id="CustomersGridView" datasourceid="CustomersSqlDataSource" autogeneratecolumns="false" datakeynames="CustomerID" runat="server"> <columns> <asp:commandfield showselectbutton="true" selecttext="Pick" headertext="Select Customer"/> <asp:boundfield datafield="CustomerID" headertext="Customer ID" /> <asp:boundfield datafield="CompanyName" headertext="Company Name"/> <asp:boundfield datafield="Address" headertext="Address"/> <asp:boundfield datafield="City" headertext="City"/> <asp:boundfield datafield="PostalCode" headertext="ZIP Code"/> <asp:boundfield datafield="Country" headertext="Country"/> </columns> </asp:gridview> <!-- This example uses Microsoft SQL Server and connects --> <!-- to the Northwind sample database. Use an ASP.NET --> <!-- expression to retrieve the connection string value --> <!-- from the Web.config file. --> <asp:sqldatasource id="CustomersSqlDataSource" selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"> </asp:sqldatasource> </form> </body> </html>
<%@ Page language="C#" %> <script runat="server"> void CustomersGridView_SelectedIndexChanged(Object sender, EventArgs e) { // Retrieve the company name from the appropriate cell. String companyName = CustomersGridView.SelectedRow.Cells[2].Text; // Display company name selected by the user. Message.Text = "You selected " + companyName + "."; } </script> <html> <body> <form runat="server"> <h3>CommandField Example</h3> <asp:Label id="Message" forecolor="Red" runat="server"/> <asp:gridview id="CustomersGridView" datasourceid="CustomersSqlDataSource" autogeneratecolumns="false" datakeynames="CustomerID" onselectedindexchanged="CustomersGridView_SelectedIndexChanged" runat="server"> <columns> <asp:commandfield showselectbutton="true" selecttext="Pick" headertext="Select Customer"/> <asp:boundfield datafield="CustomerID" headertext="Customer ID" /> <asp:boundfield datafield="CompanyName" headertext="Company Name"/> <asp:boundfield datafield="Address" headertext="Address"/> <asp:boundfield datafield="City" headertext="City"/> <asp:boundfield datafield="PostalCode" headertext="ZIP Code"/> <asp:boundfield datafield="Country" headertext="Country"/> </columns> </asp:gridview> <!-- This example uses Microsoft SQL Server and connects --> <!-- to the Northwind sample database. Use an ASP.NET --> <!-- expression to retrieve the connection string value --> <!-- from the Web.config file. --> <asp:sqldatasource id="CustomersSqlDataSource" selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"> </asp:sqldatasource> </form> </body> </html>

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


CommandField クラス
CommandField メンバ
System.Web.UI.WebControls 名前空間
ButtonFieldBase.ButtonType プロパティ
CommandField.CancelImageUrl プロパティ
CommandField.CancelText プロパティ
CommandField.DeleteImageUrl プロパティ
CommandField.DeleteText プロパティ
CommandField.EditImageUrl プロパティ
CommandField.EditText プロパティ
CommandField.InsertImageUrl プロパティ
CommandField.InsertText プロパティ
CommandField.NewImageUrl プロパティ
CommandField.NewText プロパティ
CommandField.SelectImageUrl プロパティ
ShowSelectButton
UpdateImageUrl
UpdateText
Weblioに収録されているすべての辞書からCommandField.SelectText プロパティを検索する場合は、下記のリンクをクリックしてください。

- CommandField.SelectText プロパティのページへのリンク