DataControlField.ItemStyle プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataControlField.ItemStyle プロパティの意味・解説 

DataControlField.ItemStyle プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

データ コントロール フィールド表示されるテキスト ベース内容スタイル取得します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public ReadOnly Property
 ItemStyle As TableItemStyle
Dim instance As DataControlField
Dim value As TableItemStyle

value = instance.ItemStyle
public TableItemStyle ItemStyle { get; }
public:
property TableItemStyle^ ItemStyle {
    TableItemStyle^ get ();
}
/** @property */
public TableItemStyle get_ItemStyle ()
public function get ItemStyle
 () : TableItemStyle

プロパティ
DataControlField に表示されるテキスト外観制御する TableItemStyle。

解説解説
使用例使用例

DetailsView コントロールFirstName データLastName データ表示するために使用される BoundField オブジェクトで、ItemStyle プロパティ宣言によって設定する方法次のコード例示しますDetailsView コントロールの AutoGenerateRows プロパティfalse設定されており、SelectCommand プロパティから返されデータサブセット表示できます

<%@ page language="VB" %>
<html>
<body>
  <form runat="server">

    <asp:sqldatasource
      id="SqlDataSource1"
      runat="server"
      connectionstring="<%$ ConnectionStrings:MyNorthwind%>"
      selectcommand="Select * From Employees">
    </asp:sqldatasource>

    <asp:detailsview
      id="DetailsView1"
      runat="server"
      allowpaging="True"
      datasourceid="SqlDataSource1"
      height="208px"
      width="264px"
      autogeneraterows="False">
        <fields>

          <asp:boundfield
            sortexpression="LastName"
            datafield="LastName"
            headertext="LastName">
              <itemstyle backcolor="Yellow">
              </itemstyle>
          </asp:boundfield>

          <asp:boundfield
            sortexpression="FirstName"
            datafield="FirstName"
            headertext="FirstName">
              <itemstyle forecolor="#C00000">
              </itemstyle>
          </asp:boundfield>

          <asp:buttonfield
            text="TestButton"
            buttontype="Button">
          </asp:buttonfield>

        </fields>
    </asp:detailsview>

  </form>
</body>
</html>
<%@ page language="C#" %>
<html>
<body>
  <form runat="server">

    <asp:sqldatasource
      id="SqlDataSource1"
      runat="server"
      connectionstring="<%$ ConnectionStrings:MyNorthwind%>"
      selectcommand="Select * From Employees">
    </asp:sqldatasource>

    <asp:detailsview
      id="DetailsView1"
      runat="server"
      allowpaging="True"
      datasourceid="SqlDataSource1"
      height="208px"
      width="264px"
      autogeneraterows="False">
        <fields>

          <asp:boundfield
            sortexpression="LastName"
            datafield="LastName"
            headertext="LastName">
              <itemstyle backcolor="Yellow">
              </itemstyle>
          </asp:boundfield>

          <asp:boundfield
            sortexpression="FirstName"
            datafield="FirstName"
            headertext="FirstName">
              <itemstyle forecolor="#C00000">
              </itemstyle>
          </asp:boundfield>

          <asp:buttonfield
            text="TestButton"
            buttontype="Button">
          </asp:buttonfield>

        </fields>
    </asp:detailsview>

  </form>
</body>
</html>
<%@ page language="VJ#" %>
<html>
<body>
  <form runat="server">

    <asp:sqldatasource
      id="SqlDataSource1"
      runat="server"
      connectionstring="Data Source=localhost;Integrated Security=SSPI;Initial
 Catalog=Northwind;"
      selectcommand="Select * From Employees">
    </asp:sqldatasource>

    <asp:detailsview
      id="DetailsView1"
      runat="server"
      allowpaging="True"
      datasourceid="SqlDataSource1"
      height="208px"
      width="264px"
      autogeneraterows="False">
        <fields>

          <asp:boundfield
            sortexpression="LastName"
            datafield="LastName"
            headertext="LastName">
              <itemstyle backcolor="Yellow">
              </itemstyle>
          </asp:boundfield>

          <asp:boundfield
            sortexpression="FirstName"
            datafield="FirstName"
            headertext="FirstName">
              <itemstyle forecolor="#C00000">
              </itemstyle>
          </asp:boundfield>

          <asp:buttonfield
            text="TestButton"
            buttontype="Button">
          </asp:buttonfield>

        </fields>
    </asp:detailsview>

  </form>
</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataControlField クラス
DataControlField メンバ
System.Web.UI.WebControls 名前空間
DataControlField.ControlStyle プロパティ


このページでは「.NET Framework クラス ライブラリ リファレンス」からDataControlField.ItemStyle プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDataControlField.ItemStyle プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDataControlField.ItemStyle プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DataControlField.ItemStyle プロパティ」の関連用語

DataControlField.ItemStyle プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataControlField.ItemStyle プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS