public CalcForm(TextInput inputControl) { if (inputControl.Content.parentElement != null && inputControl.Content.parentElement.parentElement != null && inputControl.Content.parentElement.parentElement.parentElement != null) { PreviousScrollTop = inputControl.Content.parentElement.parentElement.parentElement.scrollTop; ParentContainer = inputControl.Content.parentElement.parentElement.parentElement; } InputControl = inputControl; CalControl = new CalculatorControl(InputControl.GetNumberValue(), true); CalControl.SetBoundsFull(); CalControl.OnClose = () => { ClickedClose = true; this.Close(); }; CalControl.OnEqual = (value) => { InputControl.Text = value.ToString(); }; AppendChild(CalControl); Size = new Vector2(182, 157); }
public void AddingNumber2() { //Arrange string number2 = "123"; CalculatorControl addingNumber = new CalculatorControl(); //Act addingNumber.addNumber(number2); //Assert Assert.IsNull(addingNumber.SecondNumber); }
public void AddingNumber() { //Arrange string number1 = "123"; string expected = "123"; CalculatorControl addingNumber = new CalculatorControl(); //Act addingNumber.addNumber(number1); //Assert Assert.AreEqual(addingNumber.FirstNumber, expected); }
public void AddingNumber3() { //Arrange string number2 = "123"; string expected = "123"; CalculatorControl addingNumber = new CalculatorControl(); //Act addingNumber.addNumber(number2); addingNumber.addActionSymbol('+'); addingNumber.addNumber(number2); //Assert Assert.AreEqual(addingNumber.SecondNumber, expected); }
public void AddingSymbol() { //Arrange string number = "123"; char symbol = '+'; char expected = '+'; CalculatorControl addingSymbol = new CalculatorControl(); //Act addingSymbol.addNumber(number); addingSymbol.addActionSymbol(symbol); //Assert Assert.AreEqual(addingSymbol.ActionSymbol, expected); }
public override void DropDownContainerShowingDropDown(object sender, System.ComponentModel.CancelEventArgs e) { GridStyleInfo style = this.Grid.Model[RowIndex, ColIndex]; this.calci = style.Control as CalculatorControl; this.calci.ShowDisplayArea = false; this.calci.Size = new Size(260, 180); if (this.DropDownContainer != null) { this.DropDownContainer.Controls.Add(this.calci); } this.DropDownContainer.Size = this.calci.Size; this.calci.ValueCalculated += new CalculatorValueCalculatedEventHandler(calci_ValueCalculated); }
/// <summary> /// Creates a new Control based on the specified App, then adds it to MainWindow's content grid. /// </summary> public void RunApp() { #if DEBUG Logging.Logger.Instance.InsertLog(new Logging.LogEntry($"Attempting to run App: {App}")); #endif switch (App) { case PhoneApp.Photos: break; case PhoneApp.Camera: break; case PhoneApp.Settings: break; case PhoneApp.Calculator: var calculator = new CalculatorControl(); foreach (var win in Application.Current.Windows) { if (win is MainWindow m) { m.ViewModel.ChangeContent(calculator); } } break; default: return; } #if DEBUG Logging.Logger.Instance.InsertLog(new Logging.LogEntry($"Changed content to {App} successfully.")); #endif }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.calculatorControl1 = new Syncfusion.Windows.Forms.Tools.CalculatorControl(); this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.textBox2 = new Syncfusion.Windows.Forms.Tools.TextBoxExt(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.gradientPanel1 = new Syncfusion.Windows.Forms.Tools.GradientPanel(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.calculatorControl2 = new Syncfusion.Windows.Forms.Tools.CalculatorControl(); this.mainFrameBarManager1 = new Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager(this); this.bar1 = new Syncfusion.Windows.Forms.Tools.XPMenus.Bar(this.mainFrameBarManager1, "MainMenu"); this.visualStyleParentBarItem = new Syncfusion.Windows.Forms.Tools.XPMenus.ParentBarItem(); this.barItem5 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.office2016ParentBarItem = new Syncfusion.Windows.Forms.Tools.XPMenus.ParentBarItem(); this.barItem8 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.barItem9 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.barItem10 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.barItem11 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.barItem6 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.parentBarItem2 = new Syncfusion.Windows.Forms.Tools.XPMenus.ParentBarItem(); this.barItem1 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.barItem2 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.barItem3 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.barItem4 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.barItem7 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.blueBarItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.blackBarItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.silverBarItem = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.panel1 = new System.Windows.Forms.Panel(); ((System.ComponentModel.ISupportInitialize)(this.textBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gradientPanel1)).BeginInit(); this.gradientPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.mainFrameBarManager1)).BeginInit(); this.SuspendLayout(); // // calculatorControl1 // this.calculatorControl1.AccessibleDescription = "Calculator control"; this.calculatorControl1.AccessibleName = "Calculator Control"; this.calculatorControl1.AutoScroll = true; this.calculatorControl1.BeforeTouchSize = new System.Drawing.Size(292, 250); this.calculatorControl1.BorderStyle = System.Windows.Forms.Border3DStyle.Flat; this.calculatorControl1.ButtonStyle = Syncfusion.Windows.Forms.ButtonAppearance.Metro; this.calculatorControl1.Culture = new System.Globalization.CultureInfo("en-US"); this.calculatorControl1.DoubleValue = 0D; this.calculatorControl1.FlatStyle = System.Windows.Forms.FlatStyle.Standard; this.calculatorControl1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.calculatorControl1.ForeColor = System.Drawing.SystemColors.ControlText; this.calculatorControl1.HorizontalSpacing = 3; this.calculatorControl1.Location = new System.Drawing.Point(77, 72); this.calculatorControl1.MetroColor = System.Drawing.SystemColors.Control; this.calculatorControl1.Name = "calculatorControl1"; this.calculatorControl1.RightToLeft = System.Windows.Forms.RightToLeft.No; this.calculatorControl1.Size = new System.Drawing.Size(292, 250); this.calculatorControl1.TabIndex = 0; this.calculatorControl1.ThemeName = "Metro"; this.calculatorControl1.ThemesEnabled = false; this.calculatorControl1.UseVerticalAndHorizontalSpacing = true; this.calculatorControl1.UseVisualStyle = true; this.calculatorControl1.VerticalSpacing = 3; this.calculatorControl1.ValueCalculated += new Syncfusion.Windows.Forms.Tools.CalculatorValueCalculatedEventHandler(this.calculatorControl1_ValueCalculated); // // imageList1 // this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); this.imageList1.TransparentColor = System.Drawing.Color.Transparent; this.imageList1.Images.SetKeyName(0, ""); // // textBox2 // this.textBox2.BeforeTouchSize = new System.Drawing.Size(718, 105); this.textBox2.BorderColor = System.Drawing.Color.Gray; this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.textBox2.Cursor = System.Windows.Forms.Cursors.IBeam; this.textBox2.Dock = System.Windows.Forms.DockStyle.Bottom; this.textBox2.Location = new System.Drawing.Point(10, 403); this.textBox2.Metrocolor = System.Drawing.Color.Gray; this.textBox2.Multiline = true; this.textBox2.Name = "textBox2"; this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.textBox2.Size = new System.Drawing.Size(718, 105); this.textBox2.Style = Syncfusion.Windows.Forms.Tools.TextBoxExt.theme.Metro; this.textBox2.TabIndex = 4; this.textBox2.ThemeName = "Metro"; // // toolTip1 // this.toolTip1.ShowAlways = true; // // gradientPanel1 // this.gradientPanel1.BorderColor = System.Drawing.Color.Silver; this.gradientPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.gradientPanel1.Controls.Add(this.label2); this.gradientPanel1.Controls.Add(this.label1); this.gradientPanel1.Controls.Add(this.calculatorControl2); this.gradientPanel1.Controls.Add(this.calculatorControl1); this.gradientPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.gradientPanel1.Location = new System.Drawing.Point(10, 42); this.gradientPanel1.Name = "gradientPanel1"; this.gradientPanel1.Size = new System.Drawing.Size(718, 353); this.gradientPanel1.TabIndex = 18; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(400, 44); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(53, 13); this.label2.TabIndex = 22; this.label2.Text = "Financial"; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(79, 44); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(103, 13); this.label1.TabIndex = 21; this.label1.Text = "WindowsStandard"; // // calculatorControl2 // this.calculatorControl2.AccessibleDescription = "Calculator control"; this.calculatorControl2.AccessibleName = "Calculator Control"; this.calculatorControl2.AutoScroll = true; this.calculatorControl2.BeforeTouchSize = new System.Drawing.Size(292, 250); this.calculatorControl2.BorderStyle = System.Windows.Forms.Border3DStyle.Flat; this.calculatorControl2.ButtonStyle = Syncfusion.Windows.Forms.ButtonAppearance.Metro; this.calculatorControl2.Culture = new System.Globalization.CultureInfo("en-US"); this.calculatorControl2.DoubleValue = 0D; this.calculatorControl2.FlatStyle = System.Windows.Forms.FlatStyle.Standard; this.calculatorControl2.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.calculatorControl2.ForeColor = System.Drawing.SystemColors.ControlText; this.calculatorControl2.HorizontalSpacing = 3; this.calculatorControl2.LayoutType = Syncfusion.Windows.Forms.Tools.CalculatorLayoutTypes.Financial; this.calculatorControl2.Location = new System.Drawing.Point(398, 72); this.calculatorControl2.MetroColor = System.Drawing.SystemColors.Control; this.calculatorControl2.Name = "calculatorControl2"; this.calculatorControl2.RightToLeft = System.Windows.Forms.RightToLeft.No; this.calculatorControl2.Size = new System.Drawing.Size(292, 250); this.calculatorControl2.TabIndex = 20; this.calculatorControl2.Text = "calculatorControl2"; this.calculatorControl2.ThemeName = "Metro"; this.calculatorControl2.ThemesEnabled = false; this.calculatorControl2.UseVerticalAndHorizontalSpacing = true; this.calculatorControl2.UseVisualStyle = true; this.calculatorControl2.VerticalSpacing = 3; this.calculatorControl2.ValueCalculated += new Syncfusion.Windows.Forms.Tools.CalculatorValueCalculatedEventHandler(this.calculatorControl2_ValueCalculated); // // mainFrameBarManager1 // #if !NETCORE this.mainFrameBarManager1.BarPositionInfo = ((System.IO.MemoryStream)(resources.GetObject("mainFrameBarManager1.BarPositionInfo"))); #endif this.mainFrameBarManager1.Bars.Add(this.bar1); this.mainFrameBarManager1.Categories.Add("VisualStyles"); this.mainFrameBarManager1.CurrentBaseFormType = "Syncfusion.WinForms.Controls.SfForm"; this.mainFrameBarManager1.EnableMenuMerge = true; this.mainFrameBarManager1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mainFrameBarManager1.Form = this; this.mainFrameBarManager1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] { this.barItem1, this.barItem2, this.barItem3, this.barItem4, this.visualStyleParentBarItem, this.barItem7, this.barItem5, this.office2016ParentBarItem, this.blueBarItem, this.blackBarItem, this.silverBarItem, this.barItem6, this.barItem8, this.barItem9, this.barItem10, this.barItem11 }); this.mainFrameBarManager1.MetroColor = System.Drawing.Color.DeepSkyBlue; this.mainFrameBarManager1.ResetCustomization = false; this.mainFrameBarManager1.Style = Syncfusion.Windows.Forms.VisualStyle.Metro; this.mainFrameBarManager1.ThemeName = "Metro"; this.mainFrameBarManager1.ThemeStyle.ComboBoxBarItemStyle.ArrowBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); this.mainFrameBarManager1.UseBackwardCompatiblity = false; // // bar1 // this.bar1.BarName = "MainMenu"; this.bar1.BarStyle = ((Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle)((((Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.AllowQuickCustomizing | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.IsMainMenu) | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.Visible) | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.UseWholeRow))); this.bar1.Caption = "MainMenu"; this.bar1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] { this.visualStyleParentBarItem, this.parentBarItem2 }); this.bar1.Manager = this.mainFrameBarManager1; // // visualStyleParentBarItem // this.visualStyleParentBarItem.BarName = "visualStyleParentBarItem"; this.visualStyleParentBarItem.CategoryIndex = 0; this.visualStyleParentBarItem.CustomTextFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.visualStyleParentBarItem.ID = "&Visual Styles"; this.visualStyleParentBarItem.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] { this.barItem5, this.office2016ParentBarItem, this.barItem6 }); this.visualStyleParentBarItem.MetroColor = System.Drawing.Color.DeepSkyBlue; this.visualStyleParentBarItem.ShowToolTipInPopUp = false; this.visualStyleParentBarItem.SizeToFit = true; this.visualStyleParentBarItem.Text = "&Visual Styles"; this.visualStyleParentBarItem.WrapLength = 20; // // barItem5 // this.barItem5.BarName = "barItem5"; this.barItem5.CategoryIndex = 0; this.barItem5.CustomTextFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.barItem5.ID = "Office2019Colorful"; this.barItem5.ShowToolTipInPopUp = false; this.barItem5.SizeToFit = true; this.barItem5.Text = "Office2019"; this.barItem5.Click += new System.EventHandler(this.OnBarItemClick); // // office2016ParentBarItem // this.office2016ParentBarItem.BarName = "office2016ParentBarItem"; this.office2016ParentBarItem.CategoryIndex = 0; this.office2016ParentBarItem.CustomTextFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.office2016ParentBarItem.ID = "Office2016"; this.office2016ParentBarItem.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] { this.barItem8, this.barItem9, this.barItem10, this.barItem11 }); this.office2016ParentBarItem.MetroColor = System.Drawing.Color.DeepSkyBlue; this.office2016ParentBarItem.ShowToolTipInPopUp = false; this.office2016ParentBarItem.SizeToFit = true; this.office2016ParentBarItem.Style = Syncfusion.Windows.Forms.VisualStyle.Office2016Colorful; this.office2016ParentBarItem.Text = "Office2016"; this.office2016ParentBarItem.WrapLength = 20; // // barItem8 // this.barItem8.BarName = "barItem8"; this.barItem8.CategoryIndex = 0; this.barItem8.ID = "Office2016White"; this.barItem8.ShowToolTipInPopUp = false; this.barItem8.SizeToFit = true; this.barItem8.Text = "Office2016White"; this.barItem8.Click += new System.EventHandler(this.OnBarItemClick); // // barItem9 // this.barItem9.BarName = "barItem9"; this.barItem9.CategoryIndex = 0; this.barItem9.ID = "Office2016Colorful"; this.barItem9.ShowToolTipInPopUp = false; this.barItem9.SizeToFit = true; this.barItem9.Text = "Office2016Colorful"; this.barItem9.Click += new System.EventHandler(this.OnBarItemClick); // // barItem10 // this.barItem10.BarName = "barItem10"; this.barItem10.CategoryIndex = 0; this.barItem10.ID = "Office2016Black"; this.barItem10.ShowToolTipInPopUp = false; this.barItem10.SizeToFit = true; this.barItem10.Text = "Office2016Black"; this.barItem10.Click += new System.EventHandler(this.OnBarItemClick); // // barItem11 // this.barItem11.BarName = "barItem11"; this.barItem11.CategoryIndex = 0; this.barItem11.ID = "Office2016DarkGray"; this.barItem11.ShowToolTipInPopUp = false; this.barItem11.SizeToFit = true; this.barItem11.Text = "Office2016DarkGray"; this.barItem11.Click += new System.EventHandler(this.OnBarItemClick); // // barItem6 // this.barItem6.BarName = "barItem6"; this.barItem6.CategoryIndex = 0; this.barItem6.ID = "Metro"; this.barItem6.ShowToolTipInPopUp = false; this.barItem6.SizeToFit = true; this.barItem6.Text = "Metro"; this.barItem6.Click += new System.EventHandler(this.OnBarItemClick); // // parentBarItem2 // this.parentBarItem2.BarName = "parentBarItem2"; this.parentBarItem2.MetroColor = System.Drawing.Color.LightSkyBlue; this.parentBarItem2.ShowToolTipInPopUp = false; this.parentBarItem2.SizeToFit = true; this.parentBarItem2.WrapLength = 20; // // barItem1 // this.barItem1.BarName = "barItem1"; this.barItem1.ID = "_1"; this.barItem1.ShowToolTipInPopUp = false; this.barItem1.SizeToFit = true; // // barItem2 // this.barItem2.BarName = "barItem2"; this.barItem2.ID = "_2"; this.barItem2.ShowToolTipInPopUp = false; this.barItem2.SizeToFit = true; // // barItem3 // this.barItem3.BarName = "barItem3"; this.barItem3.ID = "_3"; this.barItem3.ShowToolTipInPopUp = false; this.barItem3.SizeToFit = true; // // barItem4 // this.barItem4.BarName = "barItem4"; this.barItem4.ID = "_4"; this.barItem4.ShowToolTipInPopUp = false; this.barItem4.SizeToFit = true; // // barItem7 // this.barItem7.BarName = "barItem7"; this.barItem7.CategoryIndex = 0; this.barItem7.CustomTextFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.barItem7.ID = "AboutSyncfusion"; this.barItem7.ShowToolTipInPopUp = false; this.barItem7.SizeToFit = true; this.barItem7.Text = "About Syncfusion"; this.barItem7.Click += new System.EventHandler(this.OnBarItemClick); // // blueBarItem // this.blueBarItem.BarName = "blueBarItem"; this.blueBarItem.ID = "_5"; this.blueBarItem.ShowToolTipInPopUp = false; this.blueBarItem.SizeToFit = true; // // blackBarItem // this.blackBarItem.BarName = "blackBarItem"; this.blackBarItem.ID = "_6"; this.blackBarItem.ShowToolTipInPopUp = false; this.blackBarItem.SizeToFit = true; // // silverBarItem // this.silverBarItem.BarName = "silverBarItem"; this.silverBarItem.ID = "_7"; this.silverBarItem.ShowToolTipInPopUp = false; this.silverBarItem.SizeToFit = true; // // panel1 // this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel1.Location = new System.Drawing.Point(10, 395); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(718, 8); this.panel1.TabIndex = 19; // // MainForm // this.AutoScaleBaseSize = new System.Drawing.Size(5, 15); this.ClientSize = new System.Drawing.Size(738, 518); this.Controls.Add(this.gradientPanel1); this.Controls.Add(this.panel1); this.Controls.Add(this.textBox2); this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "MainForm"; this.Padding = new System.Windows.Forms.Padding(10); this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Calculator Control"; ((System.ComponentModel.ISupportInitialize)(this.textBox2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gradientPanel1)).EndInit(); this.gradientPanel1.ResumeLayout(false); this.gradientPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.mainFrameBarManager1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
private void InitializeGrid() { #region "Style declaration" //header Style this.gridControl1.DefaultRowHeight = 22; GridStyleInfo headerstyle = new GridStyleInfo(); headerstyle.Font.Size = 12; headerstyle.Font.Bold = true; headerstyle.VerticalAlignment = GridVerticalAlignment.Middle; headerstyle.HorizontalAlignment = GridHorizontalAlignment.Center; headerstyle.CellType = GridCellTypeName.Static; //Subheader Style GridStyleInfo subheaderstyle = new GridStyleInfo(); subheaderstyle.Font.Bold = true; subheaderstyle.VerticalAlignment = GridVerticalAlignment.Middle; subheaderstyle.HorizontalAlignment = GridHorizontalAlignment.Center; subheaderstyle.CellType = GridCellTypeName.Static; //Value Style GridStyleInfo valuestyle = new GridStyleInfo(); valuestyle.BackColor = SystemColors.Menu; valuestyle.TextColor = Color.Black; valuestyle.VerticalAlignment = GridVerticalAlignment.Middle; valuestyle.HorizontalAlignment = GridHorizontalAlignment.Center; gridControl1.FloatCellsMode = GridFloatCellsMode.BeforeDisplayCalculation; #endregion #region "Date Time Picker Cells" int rowIndex = 1, colIndex = 4; gridControl1.AllowProportionalColumnSizing = true; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 1, rowIndex + 1, gridControl1.ColCount)); gridControl1[rowIndex, 1] = headerstyle; gridControl1[rowIndex, 1].Text = "Date Time Picker Cells"; rowIndex += 3; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 3, rowIndex, 5)); this.gridControl1[rowIndex, colIndex - 1].Text = "Date Picker : (MM/dd/yyyy hh:mm)"; this.gridControl1[rowIndex, colIndex - 1].TextColor = Color.Black; colIndex++; colIndex++; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, colIndex, rowIndex, colIndex + 1)); this.gridControl1.CellModels.Add("DateTimePicker", new DateTimeCellModel(this.gridControl1.Model)); this.gridControl1[rowIndex, colIndex].CellType = "DateTimePicker"; this.gridControl1[rowIndex, colIndex].CellValueType = typeof(DateTime); this.gridControl1[rowIndex, colIndex].CellValue = DateTime.Now; this.gridControl1[rowIndex, colIndex].Format = "MM/dd/yyyy hh:mm"; rowIndex++; rowIndex++; colIndex -= 2; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 3, rowIndex, 5)); this.gridControl1[rowIndex, colIndex - 1].Text = "Time Picker cell : (hh:mm:ss tt)"; this.gridControl1[rowIndex, colIndex - 1].TextColor = Color.Black; colIndex++; colIndex++; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, colIndex, rowIndex, colIndex + 1)); this.gridControl1[rowIndex, colIndex].CellType = "DateTimePicker"; this.gridControl1[rowIndex, colIndex].CellValueType = typeof(DateTime); this.gridControl1[rowIndex, colIndex].CellValue = DateTime.Now; this.gridControl1[rowIndex, colIndex].Format = "hh:mm:ss tt"; #endregion #region "DropDownGrid cells" GridControl GridA = new GridControl(); GridA.RowCount = 10; GridA.ColCount = 5; GridA.ThemesEnabled = true; GridA.CausesValidation = false; GridA[1, 1].Text = "Grid A"; GridA.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Office2007Blue; GridA.Properties.BackgroundColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(239)), ((System.Byte)(255))); GridA.Properties.GridLineColor = System.Drawing.Color.FromArgb(((System.Byte)(208)), ((System.Byte)(215)), ((System.Byte)(229))); GridA.DefaultGridBorderStyle = GridBorderStyle.Solid; GridA.ForeColor = System.Drawing.Color.MidnightBlue; GridA.Font = new System.Drawing.Font("Verdana", 8.5F); GridControl GridB = new GridControl(); GridB.RowCount = 6; GridB.ColCount = 6; GridB.CausesValidation = false; GridB.ThemesEnabled = true; GridB[1, 1].Text = "Grid B"; GridB.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Metro; DropDownGridCellModel aModel = new DropDownGridCellModel(this.gridControl1.Model); aModel.EmbeddedGrid = GridA; DropDownGridCellModel bModel = new DropDownGridCellModel(this.gridControl1.Model); bModel.EmbeddedGrid = GridB; gridControl1.CellModels.Add("GridADropCell", aModel); gridControl1.CellModels.Add("GridBDropCell", bModel); rowIndex += 3; colIndex -= 3; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 1, rowIndex + 1, gridControl1.ColCount)); gridControl1[rowIndex, 1] = headerstyle; gridControl1[rowIndex, 1].Text = "DropDown Grid Cells"; rowIndex += 3; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, colIndex, rowIndex, colIndex + 1)); this.gridControl1[rowIndex, colIndex].Text = "Grid A"; this.gridControl1[rowIndex, colIndex].CellType = "GridADropCell"; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, colIndex + 3, rowIndex, colIndex + 4)); this.gridControl1[rowIndex, colIndex + 3].Text = "Grid B"; this.gridControl1[rowIndex, colIndex + 3].CellType = "GridBDropCell"; #endregion #region "DropDown Form and User Control" rowIndex += 3; colIndex -= 2; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 1, rowIndex + 1, gridControl1.ColCount)); gridControl1[rowIndex, 1] = headerstyle; gridControl1[rowIndex, 1].Text = "DropDown Form and User Control"; rowIndex++; rowIndex++; this.gridControl1.CellModels.Add("DropDownForm", new DropDownFormCellModel(this.gridControl1.Model, new DropDownForm())); this.gridControl1.CellModels.Add("DropDownUserControl", new DropDownUserCellModel(this.gridControl1.Model, new DropDownUser())); ////DropDownForm... rowIndex++; colIndex = 3; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 3, rowIndex, 4)); gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 5, rowIndex, 7)); gridControl1[rowIndex, colIndex].Text = "DropDownForm"; gridControl1[rowIndex, colIndex].TextColor = Color.Black; this.gridControl1[rowIndex, colIndex + 2].CellType = "DropDownForm"; this.gridControl1[rowIndex, colIndex + 2].Text = "choice1,choice3"; ////DropDownForm... rowIndex++; rowIndex++; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 3, rowIndex, 4)); gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 5, rowIndex, 7)); gridControl1[rowIndex, colIndex].Text = "DropDownUserControl"; gridControl1[rowIndex, colIndex].TextColor = Color.Black; this.gridControl1[rowIndex, colIndex + 2].CellType = "DropDownUserControl"; this.gridControl1[rowIndex, colIndex + 2].Text = "choice1,choice3"; #endregion #region "DropDOwnCalculator Cell" rowIndex += 3; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 1, rowIndex + 1, gridControl1.ColCount)); gridControl1[rowIndex, 1] = headerstyle; gridControl1[rowIndex, 1].Text = "DropDown Calculator TextBox"; rowIndex++; rowIndex++; #if HELPERCLASS RegisterCellModel.GridCellType(gridControl1, CustomCellTypes.CalculatorTextBox); #else this.gridControl1.CellModels.Add("CalculatorTextBox", new DropDownCalculatorTextBoxCellModel(this.gridControl1.Model)); #endif rowIndex++; gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(rowIndex, 4, rowIndex, 6)); CalculatorControl c1 = new CalculatorControl(); c1.BorderStyle = Border3DStyle.Flat; c1.ButtonStyle = Syncfusion.Windows.Forms.ButtonAppearance.Office2007; c1.UseVisualStyle = true; GridStyleInfo style = gridControl1[rowIndex, 4]; style.CellType = "CalculatorTextBox"; style.Control = c1; style.Text = "Calculator TextBox"; this.gridControl1.Model.EnableGridListControlInComboBox = false; #endregion }