本文整理汇总了C#中System.Web.UI.WebControls.RepeaterItem.DataBind方法的典型用法代码示例。如果您正苦于以下问题:C# RepeaterItem.DataBind方法的具体用法?C# RepeaterItem.DataBind怎么用?C# RepeaterItem.DataBind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.RepeaterItem
的用法示例。
在下文中一共展示了RepeaterItem.DataBind方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InstantiateEmptyTemplate
private void InstantiateEmptyTemplate()
{
if (itemsCreated == 0 && EmptyTemplate != null)
{
System.Web.UI.WebControls.RepeaterItem ri = new System.Web.UI.WebControls.RepeaterItem(0, System.Web.UI.WebControls.ListItemType.Header);
EmptyTemplate.InstantiateIn(ri);
Controls.Add(ri);
OnItemCreated(new System.Web.UI.WebControls.RepeaterItemEventArgs(ri));
if (useDataSource)
{
ri.DataBind();
OnItemDataBound(new System.Web.UI.WebControls.RepeaterItemEventArgs(ri));
}
}
}
示例2: CreateItem
private RepeaterItem CreateItem (int itemIndex,
ListItemType itemType,
bool dataBind,
object dataItem)
{
RepeaterItem repeaterItem = new RepeaterItem (itemIndex, itemType);
RepeaterItemEventArgs repeaterEventArgs = new RepeaterItemEventArgs (repeaterItem);
InstantiateItem (repeaterItem);
if (dataBind)
repeaterItem.DataItem = dataItem;
OnItemCreated (repeaterEventArgs);
Controls.Add (repeaterItem);
if (dataBind) {
repeaterItem.DataBind ();
OnItemDataBound (repeaterEventArgs);
repeaterItem.DataItem = null;
}
return repeaterItem;
}
示例3: CreateItem
private RepeaterItem CreateItem(int itemIndex, ITemplate template, ListItemType itemType, bool dataBind, object dataItem)
{
var item = new RepeaterItem(itemIndex, itemType);
var e = new RepeaterItemEventArgs(item);
template.InstantiateIn(item);
if (dataBind)
{
item.DataItem = dataItem;
}
OnItemCreated(e);
Controls.Add(item);
if (dataBind)
{
item.DataBind();
OnItemDataBound(e);
item.DataItem = null;
}
return item;
}