public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } //create an empty work book this.workBook = new Syncfusion.Calculate.CalcWorkbook(null, null); //hook up a hidden acceptbutton to catch enter keys Button but = new Button(); this.Controls.Add(but); but.Click += new EventHandler(EnterKeyPressed); but.Size = new Size(1, 1); this.AcceptButton = but; //load a sample SSS file string fileName = @"..\\..\\..\\sample.sss"; System.IO.FileInfo fi = new System.IO.FileInfo(fileName); if (fi.Exists) { LoadFile(fileName); } }
/// <summary> /// Form Sonstructor /// </summary> public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } #region Data Initialization String commandstring = "select * from Customers"; String connection = @"Data Source=" + FindFile("NorthwindwithImage.sdf"); SqlCeDataAdapter da = new SqlCeDataAdapter(commandstring, connection); try { da.Fill(dataSet11, "Customers"); } catch (SqlException ex) { ShowErrorMessage(ex); } #endregion this.GridSettings(); // // TODO: Add any constructor code after InitializeComponent call // }
public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } this.Load += new EventHandler(Form1_Load); // // TODO: Add any constructor code after InitializeComponent call #region Initial Settings this.gridControl1.Initialize(); for (int row = 2; row != 13; row++) { this.gridControl1.Model[row, 5].Text = "Test"; } this.gridControl1.Refresh(); gridControl1.Model.Properties.GridLineColor = Color.FromArgb(208, 215, 229); this.StartPosition = FormStartPosition.CenterScreen; this.gridControl1.ThemesEnabled = true; this.gridControl1.Model.RowHeights[0] = 30; #endregion }
/// <summary> /// Form Constructor. /// </summary> public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } String commandstring1 = "select * from Customers"; String commandstring2 = "select * from Orders"; SqlCeDataAdapter da1 = new SqlCeDataAdapter(commandstring1, connString); SqlCeDataAdapter da2 = new SqlCeDataAdapter(commandstring2, connString); try { da1.Fill(dataSet11, "Customers"); da2.Fill(dataSet11, "Orders"); } catch (SqlException ex) { ShowErrorMessage(ex); } GridSettings(); }
public Form1() { InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } #region Properties gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell; gridControl1.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left; //Setting ColumnHeader Height. gridControl1.RowHeights[0] = 29; this.gridControl1.Dock = DockStyle.Fill; #endregion #region Data Random r = new Random(); this.gridControl1.RowCount = 40; this.gridControl1.ColCount = 20; for (int i = 1; i <= gridControl1.RowCount; i++) { for (int j = 1; j <= gridControl1.ColCount; j++) { gridControl1[i, j].CellValue = r.Next(10, 100).ToString(); } } #endregion }
public Form1() { InitializeComponent(); this.SfComboBoxSeetings(); try { #if NETCORE Bitmap bmp = new Bitmap(Image.FromFile(@"../../../Icon/sficon.ico")); this.Icon = Icon.FromHandle(bmp.GetHicon()); #else Bitmap bmp = new Bitmap(Image.FromFile(@"../../Icon/sficon.ico")); this.Icon = Icon.FromHandle(bmp.GetHicon()); #endif } catch (Exception ex) { } this.panel1.Paint += Panel1_Paint; if (DpiAware.GetCurrentDpi() > 96) { this.MaximizeBox = true; this.label5.Height = (int)DpiAware.LogicalToDeviceUnits(this.label5.Height); this.panel1.Width = (int)(1 + (((DpiAware.GetCurrentDpi() / 96) - 1) / 2)) * this.panel1.Width + 70; this.Width = (int)(1 + (((DpiAware.GetCurrentDpi() / 96) - 1) / 2)) * this.Width + 100; this.themeComboBox.Location = new Point(this.label12.Width + this.label12.Location.X + 5, this.themeComboBox.Location.Y); this.clearButton.Location = new Point(this.label12.Width + this.label12.Location.X + 5, this.clearButton.Location.Y); this.dropDownPosition.Location = new Point(this.label12.Width + this.label12.Location.X + 5, this.dropDownPosition.Location.Y); this.themeComboBox.Height = (int)(1 + (((DpiAware.GetCurrentDpi() / 96) - 1) / 2)) * this.themeComboBox.Height + 5; this.clearButton.Height = (int)(1 + (((DpiAware.GetCurrentDpi() / 96) - 1) / 2)) * this.clearButton.Height + 5; this.dropDownPosition.Height = (int)(1 + (((DpiAware.GetCurrentDpi() / 96) - 1) / 2)) * this.dropDownPosition.Height + 5; } }
public HubTileForm() { InitializeComponent(); try { System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(@"common\Images\Grid\Icon\sfgrid.ico")); this.Icon = ico; } catch { } this.StartPosition = FormStartPosition.CenterScreen; this.ShowIcon = true; this.defaulttile.ImageTransitionSpeed = 7; this.BannerTile.ImageTransitionSpeed = 7; this.groupBar2.SelectedItem = 0; this.groupBar1.SelectedItem = 0; this.BannerTile.TurnLiveTileOn = true; this.EnableTransition.Text = "Disable Transition"; this.MinimumSize = this.Size; this.tabControlAdv1.SelectedIndexChanging += new SelectedIndexChangingEventHandler(tabControlAdv1_SelectedIndexChanging); this.BannerTile.TurnLiveTileOn = false; if (DpiAware.GetCurrentDpi() > 96) { this.groupBar1.GroupBarItemHeight = (int)DpiAware.LogicalToDeviceUnits(30); this.groupBar2.GroupBarItemHeight = (int)DpiAware.LogicalToDeviceUnits(30); } }
public Form1() { InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } }
public Form1() { dataSet11 = new DataSet1(); InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } #region Splitter this.ActiveControl = this.splitterControl1; splitterControl1.ThemesEnabled = true; #endregion #region Grid gridControl1.Initialize(); gridControl1.ThemesEnabled = true; gridControl1.ControllerOptions &= ~(GridControllerOptions.OleDataSource | GridControllerOptions.OleDropTarget); gridControl1.CurrentCell.MoveTo(1, 1); gridControl1.BaseStylesMap["Header"].StyleInfo.Enabled = false; gridControl1.VScrollPixel = true; gridControl1.HScrollPixel = true; this.gridControl1.RowHeights[0] = 30; //tab key navigation set as false to move the next control this.gridControl1.WantTabKey = false; #endregion #region Tracer tracer = new CurrentCellEventTracer(this.splitterControl1, this.output); checkBoxMouseMessage.Checked = tracer.DisplayMouseMessages; checkBoxEnableTracing.Checked = tracer.Enabled; #endregion #region GridStyleInfo GridStyleInfo heading1 = gridControl1.BaseStylesMap["Heading 1"].StyleInfo; heading1.TextColor = Color.Blue; heading1.Font.Size = 14; heading1.Font.Bold = true; GridStyleInfo heading2 = gridControl1.BaseStylesMap["Heading 2"].StyleInfo; heading2.TextColor = Color.Blue; heading2.Font.Size = 14; heading2.Font.Bold = true; #endregion #region PropertyGrid this.output.ContextMenu = this.contextMenu1; this.propertyGrid1.CausesValidation = false; //this.splitter1.CausesValidation = false; this.panel1.CausesValidation = false; this.panel2.CausesValidation = false; #endregion // read the data from a local XML file ReadXml(this.dataSet11, @"Data\GDBDdata.XML"); }
public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } gridGroupingControl1 = new GridGroupingControl(); // now assign the datasource gridGroupingControl1.DataSource = table; SampleCustomization(); GridSettings(); Console.WriteLine(GridPropertyTypeDefaultStyleCollection.Default["System.Boolean"].Style); // enable/disable UITYpeEditors for boolean cells only and show checkbox instead. bool displayCheckBoxForBooleanFields = false; if (displayCheckBoxForBooleanFields) { GridPropertyTypeDefaultStyle booleanDefault = this.gridGroupingControl1.Engine.PropertyTypeDefaultStyles["System.Boolean"]; booleanDefault.AllowDropDown = false; } #region Sample code to get the row and column index // Sample code to get the row and column index in the grid for a column (works also // if column sets with multiple rows are specified). bool useOldCodeToGetCellInfo = false; if (useOldCodeToGetCellInfo) { GridColumnDescriptor cd = this.gridGroupingControl1.TableDescriptor.Columns["Boolean"]; int relativeRowIndex, colIndex; this.gridGroupingControl1.TableDescriptor.ColumnToRowColIndex(cd.MappingName, out relativeRowIndex, out colIndex); Record r = this.gridGroupingControl1.Table.Records[0]; int recordRowIndex = this.gridGroupingControl1.Table.DisplayElements.IndexOf(r); int rowIndex = recordRowIndex + relativeRowIndex; GridTableCellStyleInfo style = this.gridGroupingControl1.Table.GetTableCellStyle(rowIndex, colIndex + this.gridGroupingControl1.TableDescriptor.GetColumnIndentCount()); Console.WriteLine(style.TableCellIdentity.ToString()); Console.WriteLine(style.ToString()); } else { // Newer code using new GetTableCellStyle overloads after version 3.0.0.16 Record r = this.gridGroupingControl1.Table.Records[0]; GridTableCellStyleInfo style = this.gridGroupingControl1.Table.GetTableCellStyle(r, "Boolean"); Console.WriteLine(style.TableCellIdentity.ToString()); Console.WriteLine(style.ToString()); } #endregion }
public Form1() { dataSet11 = new DataSet1(); eventTracer = new EventTracer(); InitializeComponent(); if(DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } this.LoadEventTracer(); #region Splitter this.ActiveControl = this.splitterControl1; splitterControl1.ThemesEnabled = true; #endregion #region Grid gridControl1.Initialize(); gridControl1.ThemesEnabled = true; gridControl1.ControllerOptions &= ~(GridControllerOptions.OleDataSource|GridControllerOptions.OleDropTarget); gridControl1.CurrentCell.MoveTo(1, 1); gridControl1.BaseStylesMap["Header"].StyleInfo.Enabled = false; gridControl1.VScrollPixel = true; gridControl1.HScrollPixel = true; #endregion #region Tracer tracer = new CurrentCellEventTracer(this.splitterControl1, this.eventTracer); CheckBoxMouseEnable.Checked = tracer.DisplayMouseMessages; CheckBoxCurrentCellEnable.Checked = tracer.Enabled; #endregion #region GridStyleInfo GridStyleInfo heading1 = gridControl1.BaseStylesMap["Heading 1"].StyleInfo; heading1.TextColor = Color.Blue;//Color.FromArgb( 0xde, 0x64, 0x13 ); heading1.Font.Facename = "Segoe UI"; heading1.Font.Size = 12; heading1.Font.Bold = false; GridStyleInfo heading2 = gridControl1.BaseStylesMap["Heading 2"].StyleInfo; heading2.TextColor = Color.Orange; heading2.Font.Size = 12; heading2.Font.Bold = true; #endregion #region Trcaer and PropertyGrid this.eventTracer.ContextMenu = this.contextMenu1; this.propertyGrid1.CausesValidation = false; this.panel1.CausesValidation = false; this.panel2.CausesValidation = false; // read the data from a local XML file ReadXml(this.dataSet11, @"Common\Data\GDBDdata.XML"); #endregion this.GridSettings(); }
public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } GridSettings(); bool setupTableInCtor = true; if (setupTableInCtor) { // // At the time this ctor is running there is no Form.BindingContext. // We need to create a BindingContext and assign it manually to // avoid that each control creates its own BindingContext. // // If we delay accesing the GridGroupingControl records until Form1_Load // is called this workaround is not necessary. // BindingContext bc = new BindingContext(); this.gridGroupingControl1.BindingContext = bc; this.textBox1.BindingContext = bc; this.BindingContext = bc; // // If code below is executed in Form.OnLoad then the form will // already have a BindingContext and child controls will reuse // that same BindingContext. // this.dt = GetTable(); // Important: Get the dt.DefaultView, otherwise TextBox and GroupingControl // could possibly get different views to same DataTable. this.gridGroupingControl1.DataSource = this.dt.DefaultView; // When we call SetCurrent this will actually trigger initialization // of the engine data. The data will be loaded from underlying datasource // and a binding context will be created if it was not manually set before. // this.gridGroupingControl1.Table.Records[0].SetCurrent(); // Try uncommenting above line - you will see it will fail. Only when // you then uncomment also the BindingContext lines above it will work again. // // To reduce flickering it is best to setup the datasource and schema // settings in ctor. // // Code that accesses the records (like SetCurrent, calling Records.Count etc) // and DataBinding code should go into Form1_Load. } // Binding the textbox should always be done in Form1_Load this.Load += new EventHandler(Form1_Load); }
public Form1() { #region Grid Intialization Settings // // Required for Windows Form Designer support // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } // // TODO: Add any constructor code after InitializeComponent call // this.InitializeDataSet(); // Example: If you want to manually add foreign key columns and don't autopopulate them bool manualForeignKey = true; if (manualForeignKey) { // The following code shows how to avoid columns being automatically added to the parent table for each // column in the foreign table. It does instead manually add those columns // from the referenced table by setting ShowRelationFields = ShowRelationFields.Hide // and calling Columns.Add("ForeignTable.ColumnName") // Reset Relations - so that they get recreated from scratch this.gridGroupingControl1.TableDescriptor.Relations.Reset(); // NOTE: If you open DataSet1.xsd and right click on the // relation between Products and Suppliers and select "Edit Relation" // you will notice in the dialog that is shown that the // DataSet property "Create foreign key constraint only" has been checked. // This setting allows the grouping engine to differentiate between // foreign key relations and master details relations when autopopulating // relations. // this.gridGroupingControl1.ShowRelationFields = ShowRelationFields.Hide; GridTableDescriptor td = this.gridGroupingControl1.TableDescriptor.Relations[0].ChildTableDescriptor; int n = td.Columns.Add("Suppliers.CompanyName"); // . will be replaced with '_' in column.Name Console.WriteLine(td.Columns[n].Name); td.Columns[n].ReadOnly = true; td.VisibleColumns.Clear(); td.VisibleColumns.AddRange( new GridVisibleColumnDescriptor[] { new GridVisibleColumnDescriptor("ProductID"), new GridVisibleColumnDescriptor("ProductName"), new GridVisibleColumnDescriptor("UnitPrice"), new GridVisibleColumnDescriptor("Suppliers_CompanyName") }); } #endregion this.GridSettings(); }
public Form1() { InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } InitializeGrid(); this.gridControl1.ColWidths[0] = (int)DpiAware.LogicalToDeviceUnits(25); }
public Form1() { InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } GridSettings(); SampleCusomization(); }
/// <summary> /// Form Constructor. /// </summary> public Form1() { LocalizationProvider.Provider = new Localizer(); InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } GridGroupingSettings(); SampleCustomization(); }
public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } }
public Form1() { Syncfusion.Windows.Forms.LocalizationProvider.Provider = new Localizer(); InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } this.GridSettings(); this.SampleCustomization(); }
public Form1() { InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } this.GridSettings(); this.SampleCustomization(); this.gridControl1.ColWidths[0] = (int)DpiAware.LogicalToDeviceUnits(30); }
public Form1() { InitializeComponent(); this.gridControl1.DpiAware = true; if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } InitializeGrid(); this.gridControl1.ColWidths.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.IncludeCellsWithinCoveredRange); this.gridControl1.ColWidths[0] = (int)DpiAware.LogicalToDeviceUnits(25); }
public Form1() { InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } GridIntializationSettings(); this.comboBoxAdv1.SelectedIndex = 0; this.comboBoxAdv1.SelectedIndexChanged += new EventHandler(comboBoxAdv1_SelectedIndexChanged); this.propertyGrid1.SelectedObject = this.gridGroupingControl1; }
public SplitterFrame() { model = new GridModel(); SampleGrid.SetupGridModel(model); InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } grid1.Model = model; grid1.GridVisualStyles = GridVisualStyles.Metro; }
public Form1() { Random r = new Random(); InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } this.GridSettings(); this.SampleCustomization(); }
public ExcelMarkerForm() { // // Required for Windows Form Designer support // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } this.GridSettings(); this.SampleCustomization(); }
public SingleDataGridForm() { // // Required for Windows Form Designer support. // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } this.dataGrid1.FlatMode = true; }
public Form1() { InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } SampleCustomization(); this.gridControl1.TableStyle.WrapText = false; this.colorPickerButton3.ColorSelected += new EventHandler(colorPickerButton3_ColorSelected); this.checkBox1.CheckStateChanged += new EventHandler(checkBox1_CheckStateChanged); colorPickerButton3.Enabled = false; }
public Form1() { InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(@"Common\Images\Grid\Icon\sficon.ico")); this.Icon = ico; SampleCustomization(); //to set IBinding List data source as grid's datasource for initial loading. SetIBindingSource(); }
private void Form1_Load(object sender, EventArgs e) { this.sfComboBox1.SelectedIndex = 0; if (DpiAware.GetCurrentDpi() > 96) { int tabConstant = 6; int tabHeight = tabConstant * (int)(DpiAware.GetCurrentDpi() - 96) / 24; this.tabControlAdv1.Location = new Point(this.tabControlAdv1.Location.X, this.tabControlAdv1.Location.Y + tabHeight); this.label1.Location = new Point(this.label1.Location.X, this.label1.Location.Y + tabHeight / 2); this.sfComboBox1.Location = new Point(this.label1.Bounds.Right, this.label1.Location.Y); this.sfComboBox1.Size = new Size((int)DpiAware.LogicalToDeviceUnits(this.sfComboBox1.Width), this.sfComboBox1.Size.Height + tabHeight / 2); } }
public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } GridSettings(); this.gridControl1.ColWidths[0] = (int)DpiAware.LogicalToDeviceUnits(40); }
public AlgebraicExpressions() { // // Required for Windows Form Designer support. // InitializeComponent(); if (DpiAware.GetCurrentDpi() > 96) { this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight); } // // TODO: Add any constructor code after InitializeComponent call // }