public static StringBuilder PrintGridVisibleColumns(Page argPage) { StringBuilder sb = new StringBuilder(); //safety check: if (argPage == null) { return(null); } if (!(argPage is SligoCS.Web.Base.PageBase.WI.PageBaseWI)) { throw new Exception("not PageBaseWI"); } SligoCS.Web.Base.PageBase.WI.PageBaseWI page = (SligoCS.Web.Base.PageBase.WI.PageBaseWI)argPage; System.Collections.Generic.List <String> cols = page.GetVisibleColumns(); sb.Append("<br />VISIBLE COLUMNS:<br />"); sb.Append(@"<a href=""javascript:ReverseDisplay('traceVisible')"">Click to show/hide.</a>"); sb.Append(@"<div id=""traceVisible"" style=""display:none;"">"); sb.Append(String.Join(",<br />", cols.ToArray())); sb.Append(@"</div>"); return(sb); }
public static StringBuilder PrintSortProps(Page argPage) { if (argPage == null) { return(null); } if (!(argPage is SligoCS.Web.Base.PageBase.WI.PageBaseWI)) { throw new Exception("not PageBaseWI"); } StringBuilder sb = new StringBuilder(); sb.Append("<br />"); SligoCS.Web.Base.PageBase.WI.PageBaseWI page = (SligoCS.Web.Base.PageBase.WI.PageBaseWI)argPage; if (page.DataSet.Tables.Count < 1) { return(sb); } sb.Append("[Default Order By]"); sb.Append("[" + String.Join("],[", page.QueryMarshaller.BuildOrderByList(page.DataSet.Tables[0].Columns).ToArray() ) + "]" ).Append("<br /><br />"); if (page.DataGrid is WinssDataGrid) { WinssDataGrid grid = (WinssDataGrid)page.DataGrid; sb.Append("[Page.DataGrid.OrderBy] "); sb.Append("[" + String.Join("],[", grid.OrderBy.Split(",".ToCharArray())) + "]").Append("<br /><br />"); } else { sb.Append("Could not get Sort from DataGrid: not WinssDataGrid"); } if (page.Graph is WebUserControls.GraphBarChart || page.Graph is WebUserControls.GraphHorizBarChart || page.Graph is WebUserControls.GraphScatterplot) { String orderBy = String.Empty; if (page.Graph is WebUserControls.GraphBarChart) { orderBy = ((WebUserControls.GraphBarChart)page.Graph).OrderBy; } else if (page.Graph is WebUserControls.GraphHorizBarChart) { orderBy = ((WebUserControls.GraphHorizBarChart)page.Graph).OrderBy; } else if (page.Graph is WebUserControls.GraphScatterplot) { orderBy = "Scatterplot Control doesn't support Sorting"; } sb.Append("[Page.Graph.OrderBy] "); sb.Append((orderBy == null)? "NULL" : "[" + String.Join("],[", orderBy.Split(",".ToCharArray())) + "]").Append("<br /><br />"); } else { sb.Append("Could not get Sort from Graph. Control is of unexpected type, " + page.Graph.GetType().ToString()); } return(sb); }