public RepeaterItemEventArgs(RepeaterItem item) { this.item = item; }
public RepeaterCommandEventArgs(RepeaterItem item, object commandSource, CommandEventArgs originalArgs) : base(originalArgs) { this.item = item; this.commandSource = commandSource; }
private void CreateControlHierarchy(bool useDataSource) { items = new ArrayList(); IEnumerable ds = null; if (HeaderTemplate != null) { RepeaterItem header = CreateItem(-1, ListItemType.Header, false, null); } int count = -1; if (useDataSource) { ds = (IEnumerable)DataSourceHelper.ResolveDataSource(DataSource, DataMember); } else { count = (int)ViewState["ItemCount"]; if (count != -1) { ds = new DummyDataSource(count); } } if (ds != null) { int index = 0; count = 0; RepeaterItem item; ListItemType itemType = ListItemType.Item; foreach (object dataItem in (IEnumerable)ds) { if (index != 0) { RepeaterItem separator = CreateItem(-1, ListItemType.Separator, false, null); } item = CreateItem(index, itemType, useDataSource, dataItem); items.Add(item); index++; count++; if (itemType == ListItemType.Item) { itemType = ListItemType.AlternatingItem; } else { itemType = ListItemType.Item; } } } if (FooterTemplate != null) { RepeaterItem footer = CreateItem(-1, ListItemType.Footer, false, null); } if (useDataSource) { ViewState["ItemCount"] = ((ds != null) ? count : -1); } }