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

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

BoundField.NullDisplayText プロパティ

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

フィールド値が null場合フィールド表示するキャプション取得または設定します

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

Public Overridable Property
 NullDisplayText As String
Dim instance As BoundField
Dim value As String

value = instance.NullDisplayText

instance.NullDisplayText = value
public virtual string NullDisplayText { get;
 set; }
/** @property */
public String get_NullDisplayText ()

/** @property */
public void set_NullDisplayText (String value)
public function get NullDisplayText
 () : String

public function set NullDisplayText
 (value : String)

プロパティ
フィールド値が null場合フィールド表示するキャプション既定値空の文字列 ("") です。このプロパティ設定されていないことを示します

解説解説
使用例使用例

NullDisplayText プロパティ使用してnull フィールドに対して表示するカスタムキャプション指定するコード例次に示します

<%@ Page language="VB" %>

<html>
  <body>
    <form runat="server">
        
      <h3>BoundField NullDisplayText Example</h3>

      <asp:gridview id="DiscountsGridView" 
        datasourceid="DiscountsSqlDataSource" 
        autogeneratecolumns="false"
        runat="server">
                
        <columns>
                
          <asp:boundfield datafield="discounttype"
            nulldisplaytext="No Data"
            headertext="Discount Type"/>
                  
          <asp:boundfield datafield="stor_id"
            nulldisplaytext="No Data"
            headertext="Store ID"/> 
                    
          <asp:boundfield datafield="lowqty"
            nulldisplaytext="No Data"
            headertext="Low Quantity"/>
                    
          <asp:boundfield datafield="highqty"
            nulldisplaytext="No Data"
            headertext="High Quantity"/>
                    
          <asp:boundfield datafield="discount"
            nulldisplaytext="No Data"
            dataformatstring="{0:F4}%" 
            itemstyle-horizontalalign="Right" 
            headertext="Discount"/>     
                
        </columns>
                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects
 -->
      <!-- to the Pubs sample database.                   
     -->
      <asp:sqldatasource id="DiscountsSqlDataSource"
  
        selectcommand="SELECT [discounttype], [stor_id], [lowqty],
 [highqty], [discount] FROM [discounts]"
        connectionstring="<%$ ConnectionStrings:PubsConnectionString%>"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

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

<html>
  <body>
    <form runat="server">
        
      <h3>BoundField NullDisplayText Example</h3>

      <asp:gridview id="DiscountsGridView" 
        datasourceid="DiscountsSqlDataSource" 
        autogeneratecolumns="false"
        runat="server">
                
        <columns>
                
          <asp:boundfield datafield="discounttype"
            nulldisplaytext="No Data"
            headertext="Discount Type"/>
                  
          <asp:boundfield datafield="stor_id"
            nulldisplaytext="No Data"
            headertext="Store ID"/> 
                    
          <asp:boundfield datafield="lowqty"
            nulldisplaytext="No Data"
            headertext="Low Quantity"/>
                    
          <asp:boundfield datafield="highqty"
            nulldisplaytext="No Data"
            headertext="High Quantity"/>
                    
          <asp:boundfield datafield="discount"
            nulldisplaytext="No Data"
            dataformatstring="{0:F4}%" 
            itemstyle-horizontalalign="Right" 
            headertext="Discount"/>     
                
        </columns>
                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects -->
      <!-- to the Pubs sample database.                        -->
      <asp:sqldatasource id="DiscountsSqlDataSource"  
        selectcommand="SELECT [discounttype], [stor_id], [lowqty], [highqty],
 [discount] FROM [discounts]"
        connectionstring="<%$ ConnectionStrings:PubsConnectionString%>"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

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



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS