private void InitializeGrid() { Grid.MasterTableView.PagerStyle.PrevPageToolTip = LocalizeString("PagerPreviousPage.ToolTip"); Grid.MasterTableView.PagerStyle.NextPageToolTip = LocalizeString("PagerNextPage.ToolTip"); Grid.MasterTableView.PagerStyle.FirstPageToolTip = LocalizeString("PagerFirstPage.ToolTip"); Grid.MasterTableView.PagerStyle.LastPageToolTip = LocalizeString("PagerLastPage.ToolTip"); Grid.MasterTableView.PagerStyle.PageSizeLabelText = LocalizeString("PagerPageSize.Text"); foreach (var columnExtension in epm.GetGridColumnExtensionPoints("DigitalAssets", "GridColumns", Filter)) { var column = new DnnGridBoundColumn { HeaderText = columnExtension.HeaderText, DataField = columnExtension.DataField, UniqueName = columnExtension.UniqueName, ReadOnly = columnExtension.ReadOnly, Reorderable = columnExtension.Reorderable, SortExpression = columnExtension.SortExpression, HeaderTooltip = columnExtension.HeaderText }; column.HeaderStyle.Width = columnExtension.HeaderStyleWidth; var index = Math.Min(columnExtension.ColumnAt, Grid.Columns.Count - 1); Grid.Columns.AddAt(index, column); } }
protected void AddFieldGrid(object dataSource, string headerText) { var gridControl = (TemplateHelpGrid)LoadControl(Path.Combine(TemplateSourceDirectory, "TemplateHelpGrid.ascx")); var grid = gridControl.Grid; // DataBind the GridView with the Tokens DnnGridBoundColumn tokenColumn = ((DnnGridBoundColumn)grid.Columns.FindByUniqueName("StaticName")); tokenColumn.HeaderText = headerText; grid.DataSource = dataSource; grid.DataBind(); phGrids.Controls.Add(gridControl); }