public virtual void Fill() { this.PreFill(); this.dsSPOLDataSet1 = new SPOLDataSet(); this.m_StartRow = 0; this.Cursor = Cursors.WaitCursor; this.m_GridLoading = true; ThreadPool.QueueUserWorkItem(new WaitCallback(this.FillDataThread), Thread.CurrentPrincipal); }
private void SetComboBoxColumnProperties(bool setColumnsWidth) { if (DataAdapterFactory.Provider == null) { DataAdapterFactory.Provider = new SimpleDataAdapterFactory(); } DataSet dataSet = new RAD1SPOLDataSet(); if (DataAdapterFactory.Provider != null) { DataAdapterFactory.GetRAD1SPOLDataAdapter().Fill(dataSet); } System.Data.DataView dataList = new System.Data.DataView(dataSet.Tables["RAD1SPOL"]) { Sort = "RAD1SPOLNAZIV" }; CreateValueList(this.DataGrid, "RAD1SPOLRAD1SPOLID", dataList, "RAD1SPOLID", "RAD1SPOLNAZIV"); UltraGridColumn column2 = this.DataGrid.DisplayLayout.Bands["RAD1VEZASPOL"].Columns["RAD1SPOLID"]; column2.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; column2.ValueList = this.DataGrid.DisplayLayout.ValueLists["RAD1SPOLRAD1SPOLID"]; if (setColumnsWidth) { column2.Width = 190; } DataSet set = new SPOLDataSet(); if (DataAdapterFactory.Provider != null) { DataAdapterFactory.GetSPOLDataAdapter().Fill(set); } System.Data.DataView view = new System.Data.DataView(set.Tables["SPOL"]) { Sort = "NAZIVSPOL" }; CreateValueList(this.DataGrid, "SPOLIDSPOL", view, "IDSPOL", "NAZIVSPOL"); UltraGridColumn column = this.DataGrid.DisplayLayout.Bands["RAD1VEZASPOL"].Columns["IDSPOL"]; column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; column.ValueList = this.DataGrid.DisplayLayout.ValueLists["SPOLIDSPOL"]; if (setColumnsWidth) { column.Width = 190; } }
public void ChangeBinding() { this.bindingSourceSPOL.DataSource = this.SPOLController.DataSet; this.dsSPOLDataSet1 = this.SPOLController.DataSet; }
private void InitializeComponent() { this.components = new Container(); ResourceManager manager = new ResourceManager(typeof(SPOLFormUserControl)); this.contextMenu1 = new ContextMenu(); this.SetNullItem = new MenuItem(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.errorProvider1 = new ErrorProvider(); this.errorProviderValidator1 = new ErrorProviderValidator(this.components); this.bindingSourceSPOL = new BindingSource(this.components); ((ISupportInitialize)this.bindingSourceSPOL).BeginInit(); this.layoutManagerformSPOL = new TableLayoutPanel(); this.layoutManagerformSPOL.SuspendLayout(); this.layoutManagerformSPOL.AutoSize = true; this.layoutManagerformSPOL.Dock = DockStyle.Fill; this.layoutManagerformSPOL.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.layoutManagerformSPOL.AutoScroll = false; System.Drawing.Point point = new System.Drawing.Point(0, 0); this.layoutManagerformSPOL.Location = point; Size size = new System.Drawing.Size(0, 0); this.layoutManagerformSPOL.Size = size; this.layoutManagerformSPOL.ColumnCount = 2; this.layoutManagerformSPOL.RowCount = 3; this.layoutManagerformSPOL.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.layoutManagerformSPOL.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.layoutManagerformSPOL.RowStyles.Add(new RowStyle()); this.layoutManagerformSPOL.RowStyles.Add(new RowStyle()); this.layoutManagerformSPOL.RowStyles.Add(new RowStyle()); this.label1IDSPOL = new UltraLabel(); this.textIDSPOL = new UltraNumericEditor(); this.label1NAZIVSPOL = new UltraLabel(); this.textNAZIVSPOL = new UltraTextEditor(); ((ISupportInitialize)this.textIDSPOL).BeginInit(); ((ISupportInitialize)this.textNAZIVSPOL).BeginInit(); this.dsSPOLDataSet1 = new SPOLDataSet(); this.dsSPOLDataSet1.BeginInit(); this.SuspendLayout(); this.dsSPOLDataSet1.DataSetName = "dsSPOL"; this.dsSPOLDataSet1.Locale = new CultureInfo("hr-HR"); this.bindingSourceSPOL.DataSource = this.dsSPOLDataSet1; this.bindingSourceSPOL.DataMember = "SPOL"; ((ISupportInitialize)this.bindingSourceSPOL).BeginInit(); point = new System.Drawing.Point(0, 0); this.label1IDSPOL.Location = point; this.label1IDSPOL.Name = "label1IDSPOL"; this.label1IDSPOL.TabIndex = 1; this.label1IDSPOL.Tag = "labelIDSPOL"; this.label1IDSPOL.Text = "Šifra:"; this.label1IDSPOL.StyleSetName = "FieldUltraLabel"; this.label1IDSPOL.AutoSize = true; this.label1IDSPOL.Anchor = AnchorStyles.Left; this.label1IDSPOL.Appearance.TextVAlign = VAlign.Middle; this.label1IDSPOL.Appearance.Image = RuntimeHelpers.GetObjectValue(manager.GetObject("pictureBoxKey.Image")); this.label1IDSPOL.Appearance.ImageHAlign = HAlign.Right; size = new System.Drawing.Size(7, 10); this.label1IDSPOL.ImageSize = size; this.label1IDSPOL.Appearance.ForeColor = Color.Black; this.label1IDSPOL.BackColor = Color.Transparent; this.layoutManagerformSPOL.Controls.Add(this.label1IDSPOL, 0, 0); this.layoutManagerformSPOL.SetColumnSpan(this.label1IDSPOL, 1); this.layoutManagerformSPOL.SetRowSpan(this.label1IDSPOL, 1); Padding padding = new Padding(3, 1, 5, 2); this.label1IDSPOL.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1IDSPOL.MinimumSize = size; size = new System.Drawing.Size(0x2d, 0x17); this.label1IDSPOL.Size = size; point = new System.Drawing.Point(0, 0); this.textIDSPOL.Location = point; this.textIDSPOL.Name = "textIDSPOL"; this.textIDSPOL.Tag = "IDSPOL"; this.textIDSPOL.TabIndex = 0; this.textIDSPOL.Anchor = AnchorStyles.Left; this.textIDSPOL.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textIDSPOL.ReadOnly = false; this.textIDSPOL.PromptChar = ' '; this.textIDSPOL.Enter += new EventHandler(this.numericEditor_Enter); this.textIDSPOL.DataBindings.Add(new Binding("Value", this.bindingSourceSPOL, "IDSPOL")); this.textIDSPOL.NumericType = NumericType.Integer; this.textIDSPOL.MaskInput = "{LOC}-nnnnn"; this.layoutManagerformSPOL.Controls.Add(this.textIDSPOL, 1, 0); this.layoutManagerformSPOL.SetColumnSpan(this.textIDSPOL, 1); this.layoutManagerformSPOL.SetRowSpan(this.textIDSPOL, 1); padding = new Padding(0, 1, 3, 2); this.textIDSPOL.Margin = padding; size = new System.Drawing.Size(0x33, 0x16); this.textIDSPOL.MinimumSize = size; size = new System.Drawing.Size(0x33, 0x16); this.textIDSPOL.Size = size; point = new System.Drawing.Point(0, 0); this.label1NAZIVSPOL.Location = point; this.label1NAZIVSPOL.Name = "label1NAZIVSPOL"; this.label1NAZIVSPOL.TabIndex = 1; this.label1NAZIVSPOL.Tag = "labelNAZIVSPOL"; this.label1NAZIVSPOL.Text = "Spol:"; this.label1NAZIVSPOL.StyleSetName = "FieldUltraLabel"; this.label1NAZIVSPOL.AutoSize = true; this.label1NAZIVSPOL.Anchor = AnchorStyles.Left; this.label1NAZIVSPOL.Appearance.TextVAlign = VAlign.Middle; this.label1NAZIVSPOL.Appearance.ForeColor = Color.Black; this.label1NAZIVSPOL.BackColor = Color.Transparent; this.layoutManagerformSPOL.Controls.Add(this.label1NAZIVSPOL, 0, 1); this.layoutManagerformSPOL.SetColumnSpan(this.label1NAZIVSPOL, 1); this.layoutManagerformSPOL.SetRowSpan(this.label1NAZIVSPOL, 1); padding = new Padding(3, 1, 5, 2); this.label1NAZIVSPOL.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1NAZIVSPOL.MinimumSize = size; size = new System.Drawing.Size(0x2e, 0x17); this.label1NAZIVSPOL.Size = size; point = new System.Drawing.Point(0, 0); this.textNAZIVSPOL.Location = point; this.textNAZIVSPOL.Name = "textNAZIVSPOL"; this.textNAZIVSPOL.Tag = "NAZIVSPOL"; this.textNAZIVSPOL.TabIndex = 0; this.textNAZIVSPOL.Anchor = AnchorStyles.Left; this.textNAZIVSPOL.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textNAZIVSPOL.ReadOnly = false; this.textNAZIVSPOL.DataBindings.Add(new Binding("Text", this.bindingSourceSPOL, "NAZIVSPOL")); this.textNAZIVSPOL.MaxLength = 20; this.layoutManagerformSPOL.Controls.Add(this.textNAZIVSPOL, 1, 1); this.layoutManagerformSPOL.SetColumnSpan(this.textNAZIVSPOL, 1); this.layoutManagerformSPOL.SetRowSpan(this.textNAZIVSPOL, 1); padding = new Padding(0, 1, 3, 2); this.textNAZIVSPOL.Margin = padding; size = new System.Drawing.Size(0x9c, 0x16); this.textNAZIVSPOL.MinimumSize = size; size = new System.Drawing.Size(0x9c, 0x16); this.textNAZIVSPOL.Size = size; this.Controls.Add(this.layoutManagerformSPOL); this.SetNullItem.Index = 0; this.SetNullItem.Text = "Set Null"; this.SetNullItem.Click += new EventHandler(this.SetNullItem_Click); this.contextMenu1.Popup += new EventHandler(this.contextMenu1_Popup); this.contextMenu1.MenuItems.AddRange(new MenuItem[] { this.SetNullItem }); this.errorProvider1.DataSource = this.bindingSourceSPOL; this.errorProviderValidator1.ErrorProvider = this.errorProvider1; this.Name = "SPOLFormUserControl"; this.Text = "Spol"; this.AutoSize = true; this.AutoScroll = true; this.Load += new EventHandler(this.SPOLFormUserControl_Load); this.layoutManagerformSPOL.ResumeLayout(false); this.layoutManagerformSPOL.PerformLayout(); ((ISupportInitialize)this.bindingSourceSPOL).EndInit(); ((ISupportInitialize)this.textIDSPOL).EndInit(); ((ISupportInitialize)this.textNAZIVSPOL).EndInit(); this.dsSPOLDataSet1.EndInit(); this.ResumeLayout(false); this.PerformLayout(); }