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

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

GridView.EmptyDataTemplate プロパティ

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

レコード格納されていないデータ ソースに GridView コントロールバインドされている場合表示される空のデータ行用の、ユーザー定義のコンテンツ取得または設定します

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

<TemplateContainerAttribute(GetType(GridViewRow))> _
Public Overridable Property
 EmptyDataTemplate As ITemplate
Dim instance As GridView
Dim value As ITemplate

value = instance.EmptyDataTemplate

instance.EmptyDataTemplate = value
[TemplateContainerAttribute(typeof(GridViewRow))] 
public virtual ITemplate EmptyDataTemplate { get;
 set; }
[TemplateContainerAttribute(typeof(GridViewRow))] 
public:
virtual property ITemplate^ EmptyDataTemplate {
    ITemplate^ get ();
    void set (ITemplate^ value);
}
/** @property */
public ITemplate get_EmptyDataTemplate ()

/** @property */
public void set_EmptyDataTemplate (ITemplate
 value)
public function get EmptyDataTemplate
 () : ITemplate

public function set EmptyDataTemplate
 (value : ITemplate)

プロパティ
空のデータ行用のカスタム コンテンツ含んだ System.Web.UI.ITemplate。既定値null 参照 (Visual Basic では Nothing) で、このプロパティ設定されていないことを示します

解説解説
使用例使用例

レコード格納されていないデータ ソースGridView コントロールバインドされている場合表示される、空のデータ行用のカスタム テンプレート定義する方法次のコード例示します

<%@ Page language="VB" %>

<html>
  <body>
    <form runat="server">
        
      <h3>GridView EmptyDataTemplate Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="true"
        runat="server">
        
        <emptydatarowstyle backcolor="LightBlue"
          forecolor="Red"/>
                    
        <emptydatatemplate>
                
          <asp:image id="NoDataImage"
            imageurl="~/images/Image.jpg"
            runat="server"/>
                        
            No Data Found.  
                
        </emptydatatemplate> 
                
      </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. The following query        -->
      <!-- returns an empty data source to demonstrate the
      -->
      <!-- empty row.                                           -->
      <asp:sqldatasource id="CustomersSqlDataSource"
  
        selectcommand="Select [CustomerID], [CompanyName], [Address], [City],
 [PostalCode], [Country] From [Customers] Where CustomerID='NoID'"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

<%@ Page language="C#" %>

<html>
  <body>
    <form runat="server">
        
      <h3>GridView EmptyDataTemplate Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="true"
        runat="server">
        
        <emptydatarowstyle backcolor="LightBlue"
          forecolor="Red"/>
                    
        <emptydatatemplate>
                
          <asp:image id="NoDataImage"
            imageurl="~/images/Image.jpg"
            runat="server"/>
                        
            No Data Found.  
                
        </emptydatatemplate> 
                
      </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. The following query        -->
      <!-- returns an empty data source to demonstrate the      -->
      <!-- empty row.                                           -->
      <asp:sqldatasource id="CustomersSqlDataSource"  
        selectcommand="Select [CustomerID], [CompanyName], [Address], [City],
 [PostalCode], [Country] From [Customers] Where CustomerID='NoID'"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GridView クラス
GridView メンバ
System.Web.UI.WebControls 名前空間
System.Web.UI.ITemplate
GridView.EmptyDataRowStyle プロパティ
EmptyDataText
PagerTemplate



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

辞書ショートカット

すべての辞書の索引

「GridView.EmptyDataTemplate プロパティ」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS