ITemplate.InstantiateIn メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ITemplate.InstantiateIn メソッドの意味・解説 

ITemplate.InstantiateIn メソッド

クラスによって実装されている場合は、子コントロールテンプレート属すControl オブジェクト定義します。これらの子コントロールは、インライン テンプレート内で順番定義されます。

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

解説解説
使用例使用例
' Override the ITemplate.InstantiateIn method to ensure 
' that the templates are created in a Literal control and
' that the Literal object's DataBinding event is associated
' with the BindData method.
Public Sub InstantiateIn(container As
 Control) Implements ITemplate.InstantiateIn
   Dim l As New Literal()
   AddHandler l.DataBinding, AddressOf Me.BindData
   container.Controls.Add(l)
End Sub 'InstantiateIn

' Create a public method that will handle the
' DataBinding event called in the InstantiateIn method.
Public Sub BindData(sender As
 Object, e As EventArgs)
   Dim l As Literal = CType(sender, Literal)
   Dim container As DataGridItem = CType(l.NamingContainer,
 DataGridItem)
   l.Text = CType(container.DataItem, DataRowView)(column).ToString()
End Sub 'BindData 
// Override the ITemplate.InstantiateIn method to ensure 
// that the templates are created in a Literal control and
// that the Literal object's DataBinding event is associated
// with the BindData method.
public void InstantiateIn(Control container)
{
    Literal l = new Literal();
    l.DataBinding += new EventHandler(this.BindData);
    container.Controls.Add(l);
}
// Create a public method that will handle the
// DataBinding event called in the InstantiateIn method.
public void BindData(object sender, EventArgs
 e)
{
    Literal l = (Literal) sender;
    DataGridItem container = (DataGridItem) l.NamingContainer;
    l.Text = ((DataRowView) container.DataItem)[column].ToString();
    
}
// Override the ITemplate.InstantiateIn method to ensure 
// that the templates are created in a Literal control and
// that the Literal object's DataBinding event is associated
// with the BindData method.
public void InstantiateIn(Control container)
{
    Literal l = new Literal();
    l.add_DataBinding(new EventHandler(this.BindData));
    container.get_Controls().Add(l);
} //InstantiateIn

// Create a public method that will handle the
// DataBinding event called in the InstantiateIn method.
public void BindData(Object sender, EventArgs
 e)
{
    Literal l = (Literal)sender;
    DataGridItem container = (DataGridItem)l.get_NamingContainer();
    l.set_Text(((DataRowView)container.get_DataItem()).
        get_Item(column).ToString());
} //BindData 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「ITemplate.InstantiateIn メソッド」の関連用語

ITemplate.InstantiateIn メソッドのお隣キーワード
検索ランキング

   

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



ITemplate.InstantiateIn メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS