private void ReGroupDataSets(RefreshType refreshType) { if (refreshType.Equals(RefreshType.Full) || refreshType.Equals(RefreshType.View)) try { ////Specify relations in grouping engine gridRelationDescriptors.Clear(); gridGroupingControl1.TableDescriptor.Relations.Clear(); foreach (DashboardView view in Config.Views.Values) { //------------------------------------------------- //Uncomment this line for child views //------------------------------------------------- AddGridRelationDescriptor(view); } foreach (DashboardView view in Config.Views.Values) { if (gridRelationDescriptors.ContainsKey(view.Alias)) { foreach (string hiddenField in view.HiddenFields) { gridRelationDescriptors[view.Alias].ChildTableDescriptor.VisibleColumns.Remove(hiddenField); } } } if (tsbGroup.SelectedItem != null) GroupColumn(tsbGroup.SelectedItem.ToString()); gridGroupingControl1.TableDescriptor.VisibleColumns.Clear(); foreach (DataColumn col in gridRelationDataSets["GetDashboardProcessList"].Table.Columns) gridGroupingControl1.TableDescriptor.VisibleColumns.Add(col.ColumnName); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove(tsbGroup.SelectedItem.ToString()); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("ActivityId"); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("ProcessId"); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Schedule Name"); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Description"); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Total"); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Success"); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Failed"); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("SLA"); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("ViewId"); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Expected Start Time"); gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Expected Completion Time"); gridGroupingControl1.TopLevelGroupOptions.ShowFilterBar = true; GridColumnDescriptorCollection descColl = gridGroupingControl1.TableDescriptor.Columns; foreach (GridColumnDescriptor desc in descColl) desc.AllowFilter = true; } catch (Exception ex) { log.Error(ex); } }
private void RefreshMenus(RefreshType refreshType) { if (refreshType.Equals(RefreshType.Full)) { DataSet dsViewList = DashboardData.GetViewList(); BuildViewMenu(dsViewList); if (filterSettings.Count == 0) { if (tsbView.Items.Count > 0) tsbView.SelectedIndex = 0; if (tsbGroup.Items.Count > 0) tsbGroup.SelectedIndex = 0; } filterSettings.Clear(); filterSettings.Add("View", viewId); filterSettings.Add("Group", tsbGroup.SelectedIndex); tsbGroup.SelectedIndex = filterSettings["Group"]; } }
private void RefreshDatasources(RefreshType refreshType) { try { if (refreshType.Equals(RefreshType.Full) || refreshType.Equals(RefreshType.Data)) { gridRelationDataSets.Clear(); DataView dv = ((DataSet)DashboardData.GetDashboard(dtPicker.Value, 1)).Tables[0].DefaultView; //failsafe if (dv == null || dv.Table.Rows.Count == 0) dv = ((DataSet)DashboardData.GetDashboard(dtPicker.Value, 1)).Tables[0].DefaultView; gridRelationDataSets.Add("GetDashboardProcessList", dv); dvProcesses = dv; } } catch (Exception ex) { log.Error(ex); } }
private void RefreshFilter(RefreshType refreshType) { if (refreshType.Equals(RefreshType.Full) || refreshType.Equals(RefreshType.View)) { if (gridRelationDataSets.ContainsKey("GetDashboardProcessList")) { gridGroupingControl1.DataSource = gridRelationDataSets["GetDashboardProcessList"]; gridGroupingControl1.Engine.SourceListSet.Clear(); gridGroupingControl1.Engine.SourceListSet.Add("GetDashboardProcessList", gridRelationDataSets["GetDashboardProcessList"]); } } if (dvProcesses != null) { if (!String.IsNullOrEmpty(filterView) && String.IsNullOrEmpty(filterStatus)) dvProcesses.RowFilter = filterView; else if (String.IsNullOrEmpty(filterView) && !String.IsNullOrEmpty(filterStatus)) dvProcesses.RowFilter = filterStatus; else if (!String.IsNullOrEmpty(filterView) && !String.IsNullOrEmpty(filterStatus)) dvProcesses.RowFilter = filterView + " AND " + filterStatus; else dvProcesses.RowFilter = String.Empty; } }