private void Bind(int page) { List <Plugin> plugins = GetFilteredList(); // Get the asset count int total = plugins.Count; // Setup the pager BottomPager.CurrentPage = page; BottomPager.PageSize = PageSize; BottomPager.ItemCount = total; BottomPager.CalculatePageCount(); // Setup page variables CurrentPage = page; RecordCount = total; TotalPages = BottomPager.PageCount; //sort the plugins Sort(plugins); // Bind the asset list to relevant page PluginsRepeater.DataSource = plugins.Skip((CurrentPage - 1) * PageSize).Take(PageSize); PluginsRepeater.DataBind(); // Toggle no results panel PluginsRepeater.Visible = (plugins.Count > 0); NoResultsPanel.Visible = (plugins.Count == 0); }
private void RefreshPlugins() { using (DataTable dataSource = new DataTable()) { dataSource.Locale = CultureInfo.InvariantCulture; dataSource.Columns.Add("Name"); dataSource.Columns.Add("FullName"); foreach (string layerName in GetLayerNames()) { DataRow row = dataSource.NewRow(); row["Name"] = layerName; row["FullName"] = layerName; dataSource.Rows.Add(row); } PluginsRepeater.DataSource = dataSource; PluginsRepeater.DataBind(); } }