private void GridSetting() { GridConditionalFormatDescriptor format1 = new GridConditionalFormatDescriptor(); format1.Appearance.AnyRecordFieldCell.TextColor = Color.Black; format1.Appearance.AnyRecordFieldCell.Interior = new BrushInfo(Color.LightPink); format1.Expression = "[DOS1_5]='' OR [DOS1_5]='0'" + "OR [DOS1_5]='' OR [DOS1_5]='0'" + "OR [DOS6_10]='' OR [DOS6_10]='0'" + "OR [DOS11_15]='' OR [DOS11_15]='0'" + "OR [DOS16_20]='' OR [DOS16_20]='0'" + "OR [DOS21_25]='' OR [DOS21_25]='0'" + "OR [DOS26_31]='' OR [DOS26_31]='0'"; DG2.TableDescriptor.ConditionalFormats.Add(format1); DG2.ThemesEnabled = false; DG2.Appearance.ColumnHeaderCell.Themed = false; DG2.Appearance.ColumnHeaderCell.Interior = new BrushInfo(GradientStyle.Vertical, Color.LightSkyBlue, Color.White); DG2.Appearance.ColumnHeaderCell.TextColor = Color.Black; DG2.TableDescriptor.VisibleColumns.Remove("VendorID"); DG2.TableDescriptor.Appearance.AnyCell.TextColor = Color.Black; DG2.TableDescriptor.Appearance.AnyRecordFieldCell.Font = new Syncfusion.Windows.Forms.Grid.GridFontInfo(new Font("Arial", 10f, FontStyle.Regular)); DG2.TableDescriptor.Columns["Product_Name"].Appearance.AnyRecordFieldCell.HorizontalAlignment = GridHorizontalAlignment.Left; DG2.TableDescriptor.Columns["Product_Name"].Appearance.AnyRecordFieldCell.WrapText = true; DG2.TableDescriptor.Columns["Product_Name"].Width = 365; DG2.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false; DG2.TopLevelGroupOptions.ShowCaption = false; DG2.AllowProportionalColumnSizing = false; DG2.TableDescriptor.Columns["DOS1_5"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.ComboBox; DG2.TableDescriptor.Columns["DOS6_10"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.OriginalTextBox; DG2.TableDescriptor.Columns["DOS11_15"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.FormulaCell; DG2.TableDescriptor.Columns["DOS16_20"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.TextBox; DG2.TableDescriptor.Columns["DOS1_5"].Appearance.AnyCell.ReadOnly = false; DG2.TableDescriptor.Columns["DOS6_10"].Appearance.AnyCell.ReadOnly = false; DG2.TableDescriptor.Columns["DOS11_15"].Appearance.AnyCell.ReadOnly = false; DG2.TableDescriptor.Columns["DOS16_20"].Appearance.AnyCell.ReadOnly = false; DG2.TableDescriptor.Columns["DOS21_25"].Appearance.AnyCell.ReadOnly = false; DG2.TableDescriptor.Columns["DOS26_31"].Appearance.AnyCell.ReadOnly = false; GridMetroColors colors = new GridMetroColors(); colors.PushButtonColor.NormalBackColor = Color.FromArgb(22, 165, 220); colors.PushButtonColor.HoverBackColor = Color.FromArgb(26, 198, 255); colors.PushButtonColor.PushedBackColor = Color.FromArgb(120, 191, 217); this.DG2.SetMetroStyle(colors); DG2.TableDescriptor.AllowNew = false; DG2.Refresh(); DG2.Invalidate(); DG2.TableControl.RefreshRange(GridRangeInfo.Table()); }
private void GridSetting() { GridConditionalFormatDescriptor format1 = new GridConditionalFormatDescriptor(); format1.Appearance.AnyRecordFieldCell.TextColor = Color.Black; format1.Appearance.AnyRecordFieldCell.Interior = new BrushInfo(Color.LightGreen); format1.Expression = "[Status]='Sent' OR [Status]='SENT' "; DG2.TableDescriptor.ConditionalFormats.Add(format1); DG2.ThemesEnabled = false; DG2.Appearance.ColumnHeaderCell.Themed = false; DG2.Appearance.ColumnHeaderCell.Interior = new BrushInfo(GradientStyle.Vertical, Color.LightSkyBlue, Color.White); DG2.Appearance.ColumnHeaderCell.TextColor = Color.Black; DG2.TableDescriptor.VisibleColumns.Remove("VendorID"); DG2.TableDescriptor.Appearance.AnyCell.TextColor = Color.Black; DG2.TableDescriptor.Appearance.AnyRecordFieldCell.Font = new Syncfusion.Windows.Forms.Grid.GridFontInfo(new Font("Arial", 10f, FontStyle.Regular)); DG2.TableDescriptor.Columns["Vendor"].Appearance.AnyRecordFieldCell.HorizontalAlignment = GridHorizontalAlignment.Left; DG2.TableDescriptor.Columns["Vendor"].Appearance.AnyRecordFieldCell.WrapText = true; DG2.TableDescriptor.Columns["Vendor"].Width = 250; DG2.TableDescriptor.Columns["Email"].Width = 150; DG2.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false; DG2.TopLevelGroupOptions.ShowCaption = false; DG2.AllowProportionalColumnSizing = false; GridMetroColors colors = new GridMetroColors(); colors.PushButtonColor.NormalBackColor = Color.FromArgb(22, 165, 220); colors.PushButtonColor.HoverBackColor = Color.FromArgb(26, 198, 255); colors.PushButtonColor.PushedBackColor = Color.FromArgb(120, 191, 217); this.DG2.SetMetroStyle(colors); DG2.TableDescriptor.AllowNew = false; DG2.Refresh(); DG2.Invalidate(); DG2.TableControl.RefreshRange(GridRangeInfo.Table()); }
private void GridSetting() { DG2.ThemesEnabled = false; DG2.Appearance.ColumnHeaderCell.Themed = false; DG2.Appearance.ColumnHeaderCell.Interior = new BrushInfo(GradientStyle.Vertical, Color.Red, Color.White); DG2.Appearance.ColumnHeaderCell.TextColor = Color.Black; DG2.TableDescriptor.VisibleColumns.Remove("VendorID"); DG2.TableDescriptor.Appearance.AnyCell.BackColor = Color.White; DG2.TableDescriptor.Columns["Email"].Appearance.AnyRecordFieldCell.HorizontalAlignment = GridHorizontalAlignment.Left; DG2.TableDescriptor.Columns["Email"].Appearance.AnyRecordFieldCell.WrapText = true; DG2.TableDescriptor.Columns["Email"].Width = 180; DG2.TableDescriptor.Columns["Phone"].Appearance.AnyRecordFieldCell.HorizontalAlignment = GridHorizontalAlignment.Left; DG2.TableDescriptor.Columns["Phone"].Appearance.AnyRecordFieldCell.WrapText = true; DG2.TableDescriptor.Columns["Phone"].Width = 95; DG2.TableDescriptor.Columns["MON"].Width = 40; DG2.TableDescriptor.Columns["TUE"].Width = 35; DG2.TableDescriptor.Columns["WED"].Width = 35; DG2.TableDescriptor.Columns["THU"].Width = 35; DG2.TableDescriptor.Columns["FRI"].Width = 35; DG2.TableDescriptor.Columns["SAT"].Width = 35; DG2.TableDescriptor.Columns["SUN"].Width = 35; DG2.TableDescriptor.Columns["Auto_Ordering"].Width = 35; DG2.TableDescriptor.Columns["Set_Dos"].Width = 60; this.DG2.TableDescriptor.Columns["Auto_Ordering"].HeaderText = "Auto"; DG2.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false; DG2.TopLevelGroupOptions.ShowCaption = false; DG2.AllowProportionalColumnSizing = false; DG2.TableDescriptor.Columns["Vendor"].Width = 220; DG2.TableDescriptor.Columns["Vendor"].Appearance.AnyRecordFieldCell.AllowEnter = false; DG2.TableDescriptor.Columns["Vendor"].Appearance.AnyRecordFieldCell.HorizontalAlignment = GridHorizontalAlignment.Left; // DG.TableDescriptor.Columns["OrderTime"].Appearance.AnyRecordFieldCell.Format = "dd/MM/yyyy"; // DG.Refresh(); // DG2.TableDescriptor.Columns["OrderTime"].Appearance.AnyRecordFieldCell.ReadOnly = false; DG2.TableDescriptor.Columns["OrderTime"].Appearance.AnyRecordFieldCell.CellValueType = typeof(DateTime); DG2.TableDescriptor.Columns["OrderTime"].Appearance.AnyRecordFieldCell.Format = "HH:ss"; DG2.TableDescriptor.Columns["OrderTime"].Width = 70; DG2.TableDescriptor.Columns["DayOfMonth"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.ComboBox; DG2.TableDescriptor.Columns["DayOfMonth"].Appearance.AnyRecordFieldCell.DataSource = Get_DOM_ArrayList(); // DG2.TableDescriptor.Columns["DayOfMonth"].Appearance.AnyRecordFieldCell.ReadOnly = false; DG2.TableDescriptor.Columns["Method"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.ComboBox; DG2.TableDescriptor.Columns["Method"].Appearance.AnyRecordFieldCell.DataSource = Get_Method_ArrayList(); // DG2.TableDescriptor.Columns["Method"].Appearance.AnyRecordFieldCell.ReadOnly = false; DG2.TableDescriptor.Appearance.AnyRecordFieldCell.Font = new Syncfusion.Windows.Forms.Grid.GridFontInfo(new Font("Arial", 10f, FontStyle.Regular)); DG2.TableDescriptor.Appearance.AnyRecordFieldCell.TextColor = Color.Black; DG2.TableDescriptor.Columns["Auto_Ordering"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.CheckBox; DG2.TableDescriptor.Columns["Auto_Ordering"].Appearance.AnyCell.BackColor = Color.Yellow; DG2.TableDescriptor.Columns["Set_Dos"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.PushButton; DG2.TableDescriptor.Columns["Set_Dos"].Appearance.AnyRecordFieldCell.Description = "Set Dos"; DG2.TableDescriptor.Columns["Set_Dos"].Appearance.AnyRecordFieldCell.BackColor = Color.Yellow; // DG2.TableDescriptor.Columns["Review"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.PushButton; DG2.TableDescriptor.Columns["Remove"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.PushButton; DG2.TableDescriptor.Columns["Remove"].Appearance.AnyRecordFieldCell.Description = "Remove "; DG2.TableDescriptor.Columns["Remove"].Appearance.AnyHeaderCell.Text = "Remove Vendor"; //DG2.TableDescriptor.Columns["MON"].Appearance.AnyRecordFieldCell.ReadOnly = false; //DG2.TableDescriptor.Columns["TUE"].Appearance.AnyRecordFieldCell.ReadOnly = false; //DG2.TableDescriptor.Columns["WED"].Appearance.AnyRecordFieldCell.ReadOnly = false; //DG2.TableDescriptor.Columns["THU"].Appearance.AnyRecordFieldCell.ReadOnly = false; //DG2.TableDescriptor.Columns["FRI"].Appearance.AnyRecordFieldCell.ReadOnly = false; //DG2.TableDescriptor.Columns["SAT"].Appearance.AnyRecordFieldCell.ReadOnly = false; //DG2.TableDescriptor.Columns["SUN"].Appearance.AnyRecordFieldCell.ReadOnly = false; //DG2.TableDescriptor.Columns["Phone"].Appearance.AnyRecordFieldCell.ReadOnly = false; //DG2.TableDescriptor.Columns["Email"].Appearance.AnyRecordFieldCell.ReadOnly = false; //DG2.TableDescriptor.Columns["Auto_Ordering"].Appearance.AnyRecordFieldCell.ReadOnly = false; GridMetroColors colors = new GridMetroColors(); colors.PushButtonColor.NormalBackColor = Color.FromArgb(22, 165, 220); colors.PushButtonColor.HoverBackColor = Color.FromArgb(26, 198, 255); colors.PushButtonColor.PushedBackColor = Color.FromArgb(120, 191, 217); this.DG2.SetMetroStyle(colors); DG2.TableDescriptor.AllowNew = false; DG2.Refresh(); DG2.Invalidate(); DG2.TableControl.RefreshRange(GridRangeInfo.Table()); // DG.TableDescriptor.VisibleColumns.Remove("VendorID"); //InformationGrid.Columns["VendorID"].Visible = false; //InformationGrid.Columns["Vendor"].Width = 150; //InformationGrid.Columns["Email"].Width = 200; //InformationGrid.Columns["Mon"].Width = 35; //InformationGrid.Columns["Tue"].Width = 35; //InformationGrid.Columns["Wed"].Width = 35; //InformationGrid.Columns["Thu"].Width = 35; //InformationGrid.Columns["Fri"].Width = 35; //InformationGrid.Columns["Sat"].Width = 35; //InformationGrid.Columns["Sun"].Width = 35; //InformationGrid.Columns["setDos"].DefaultCellStyle.ForeColor = Color.Blue; //InformationGrid.Columns["Update_Record"].DefaultCellStyle.ForeColor = Color.Black; //InformationGrid.Columns["Update_Record"].DefaultCellStyle.BackColor = Color.Yellow; //InformationGrid.Columns["Update_Record"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; ; //InformationGrid.Columns["Update_Record"].ReadOnly = true; }