protected void BindToList(List <int> assetIdList) { AssetIdList = assetIdList; AssetFinder finder = new AssetFinder(); finder.AssetIdList.Add(0); finder.AssetIdList.AddRange(assetIdList); EntityList <Asset> assetList = Asset.FindMany(finder); AssetList AssetList = (AssetList)SiteUtils.FindControlRecursive(Page, "AssetList1"); AssetList.Repeater.DataSource = assetList; AssetList.Repeater.DataBind(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); PageSizeDropDownList PageSizeDropDownList1 = (PageSizeDropDownList)SiteUtils.FindControlRecursive(this, "PageSizeDropDownList1"); PageSizeDropDownList1.AutoPostBack = true; PageSizeDropDownList1.SelectedIndexChanged += new EventHandler(PageSizeDropDownList1_SelectedIndexChanged); Grid.SortCommand += new DataGridSortCommandEventHandler(Grid_SortCommand); Grid.EditCommand += new DataGridCommandEventHandler(Grid_EditCommand); Grid.CancelCommand += new DataGridCommandEventHandler(Grid_CancelCommand); Grid.ItemDataBound += new DataGridItemEventHandler(Grid_ItemDataBound); Grid.UpdateCommand += new DataGridCommandEventHandler(Grid_UpdateCommand); Grid.DeleteCommand += new DataGridCommandEventHandler(Grid_DeleteCommand); Grid.ItemCommand += new DataGridCommandEventHandler(Grid_ItemCommand); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!Page.IsPostBack) { PageSizeDropDownList PageSizeDropDownList1 = (PageSizeDropDownList)SiteUtils.FindControlRecursive(this, "PageSizeDropDownList1"); PageSizeDropDownList1.SafeSelectValue(SavedSearch.PageSize); if (SavedSearch.HasSearch) { RetrieveSearchAndBindGrid(); } else if (BindOnLoad) { PerformSearchAndBindGrid(1); } } }
protected override void Render(HtmlTextWriter writer) { // Required on all pages as part of license. // Removal is a breach of conditions of use // Using string concat to avoid being found easily with find and replace string relativePath = VirtualPathUtility.ToAppRelative(Request.Url.AbsolutePath).ToLower(); if (relativePath != "~/default.aspx") { if (SiteUtils.FindControlRecursive(Page, "Attr" + "ibu" + "tio" + "nFo" + "oter") == null) { writer.Write("Att" + "ribu" + "tio" + "n Fo" + "ote" + "r mus" + "t be" + " on a" + "ll pa" + "ges"); return; } } base.Render(writer); }
protected void UpdatePagingControls(PagingInfo pagingInfo) { // Get each pager SimplePager TopPager = (SimplePager)SiteUtils.FindControlRecursive(this, "TopPager"); SimplePager BottomPager = (SimplePager)SiteUtils.FindControlRecursive(this, "BottomPager"); // Update the top pager TopPager.CurrentPage = pagingInfo.CurrentPage + 1; TopPager.PageSize = pagingInfo.PageSize; TopPager.PageCount = pagingInfo.TotalPages; TopPager.ItemCount = pagingInfo.TotalRecords; // Update the bottom pager BottomPager.CurrentPage = TopPager.CurrentPage; BottomPager.PageSize = TopPager.PageSize; BottomPager.PageCount = TopPager.PageCount; BottomPager.ItemCount = TopPager.ItemCount; // Set page-based paging info CurrentPage = TopPager.CurrentPage; TotalPages = pagingInfo.TotalPages; RecordCount = pagingInfo.TotalRecords; }
/// <summary> /// Performs the search and binds the grid /// </summary> /// <param name="finder">Finder to perform search</param> /// <param name="page">Page number - 1 based index</param> protected virtual void PerformSearchAndBindGrid(FinderType finder, int page) { if (page > 0) { page--; } EntityList <EntityType> data = GetData(finder, page); BindGrid(data); bool isEmptyResultSet = (data.Count == 0); Panel NoResultsPanel = (Panel)SiteUtils.FindControlRecursive(this, "NoResultsPanel"); DataControl.Visible = (!isEmptyResultSet); NoResultsPanel.Visible = (isEmptyResultSet); TogglePanels(isEmptyResultSet); UpdateSavedSearch(finder, page); UpdatePagingControls(data.PagingInfo); }