public void BindControls() { if (Questionnaire == null) MessageBox.Show("Questionnaire must be bind with JSON first.", "MultipleChoice Component"); isLoaded = false; this.layoutControlGroupQuestion1.Clear(); Settings oSettings = Questionnaire.Form.Settings; m_DynamicControls = new List<DynamicControl>(); // layoutControlGroupQuestion1 this.layoutControlGroupQuestion1.Name = "layoutControlGroupQuestion" + Guid.NewGuid().ToString(); this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true; this.layoutControlGroupQuestion1.ExpandButtonVisible = false; this.layoutControlGroupQuestion1.GroupBordersVisible = true; this.layoutControlGroupQuestion1.TextVisible = false; this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1,1, 1); this.layoutControlGroupQuestion1.ShowInCustomizationForm = false; //this.layoutControlGroupQuestion1.Size = new System.Drawing.Size(417, 64); //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText; this.layoutControlGroupQuestion1.BeginUpdate(); #region Footer this.layoutControlItem1 = new LayoutControlItem(); this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString(); //bool isCustomerOwnershipOnly = false; //if (oSettings.CustomerOwnership && oSettings.BVOwnership) // isCustomerOwnershipOnly = true; //ctlFooter = new Footer() { // IsAccountLevel = oSettings.DataBindings.account_level, // IsCustomerOwnershipOnly = isCustomerOwnershipOnly, // HelpText = oSettings.QuestionHelp, // LanguageCode = oSettings.DataBindings.language_code //}; ctlFooter = new Footer() { IsAccountLevel = oSettings.DataBindings.account_level, IsCustomerOwned = oSettings.CustomerOwnership, IsBrightvisionOwned = oSettings.BVOwnership, HelpText = oSettings.QuestionHelp, LanguageCode = oSettings.DataBindings.language_code, QuestionText = oSettings.Label + " " + oSettings.QuestionText }; ctlFooter.InitializeFooter(); ctlFooter.Dock = DockStyle.Fill; ctlFooter.Height = 20; this.layoutControlItem1.Control = ctlFooter; this.layoutControlItem1.ShowInCustomizationForm = false; this.layoutControlItem1.TextVisible = false; this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlItem1.MinSize = new Size(0, 24); this.layoutControlItem1.MaxSize = new Size(0, 24); this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1); #endregion IList<AnswerOption> answeroptionList = Questionnaire.Form.Settings.AnswerOptions; IMultipleChoice answeroption = null; List<MultipleChoiceValue> mcvalueList = null; int iAnswerOptions = answeroptionList.Count; int numCols = 1; int numRows = 1; LayoutControlItem refColItem = null, prevItem = null, lastItem = null; List<LayoutControlItem> listItems = null; int idx = 0; int refColItemWidth = 0; for (int x = 0; x < iAnswerOptions; ++x) { answeroption = answeroptionList[x] as IMultipleChoice; simpleLabelItemValidation = new SimpleLabelItem(); simpleLabelItemValidation.AppearanceItemCaption.BackColor = Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); simpleLabelItemValidation.Name = Guid.NewGuid().ToString(); simpleLabelItemValidation.TextAlignMode = TextAlignModeItem.CustomSize; simpleLabelItemValidation.TextSize = new Size(212, 15); simpleLabelItemValidation.Text = " Please check at least one item below."; simpleLabelItemValidation.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; this.layoutControlGroupQuestion1.AddItem(simpleLabelItemValidation); mcvalueList = answeroption.MultipleChoiceValues; numCols = answeroption.MultipleChoiceColumns; numRows = Convert.ToInt16(Math.Ceiling(Convert.ToDouble(mcvalueList.Count) / Convert.ToDouble(numCols))); listItems = new List<LayoutControlItem>(); for (int i = 1; i <= numCols; ++i) { for (int q = 1; q <= numRows && idx < mcvalueList.Count ; ++q) { if (i > 1 && q == 1) { lastItem = refColItem; } if (q == 1) { refColItem = new LayoutControlItem(); refColItem.Padding = new DevExpress.XtraLayout.Utils.Padding(0); refColItem.Spacing = new DevExpress.XtraLayout.Utils.Padding(0); //add checkedit this.checkEdit1 = new CheckEdit(); this.checkEdit1.Tag = new MultiplechoiceData() { ParentPositionIndex = "IndexPosition" + x.ToString(), PositionIndex = "IndexPosition" + idx, ControlContainer = refColItem }; this.checkEdit1.Text = mcvalueList[idx].TextPrefix; this.checkEdit1.Checked = mcvalueList[idx].Checked; this.checkEdit1.Name = "checkEdit" + Guid.NewGuid().ToString(); //this.checkEdit1.StyleController = this.StyleController; this.checkEdit1.AutoSizeInLayoutControl = true; checkEdit1.CheckedChanged += new EventHandler(checkEdit1_CheckedChanged); m_DynamicControls.Add(new DynamicControl() { Control = this.checkEdit1, Name = this.checkEdit1.Name, DefaultValue = this.checkEdit1.Checked, TextPrefix = this.checkEdit1.Text }); refColItem.Name = "layoutControlItem" + Guid.NewGuid().ToString(); refColItem.Control = this.checkEdit1; refColItem.TextVisible = false; refColItem.MinSize = new Size(0, 17); refColItem.MaxSize = new Size(0, 17); refColItem.SizeConstraintsType = SizeConstraintsType.Custom; refColItem.Click += new EventHandler(layoutControlGroupQuestion1_Click); refColItem.AllowAutoAlignment = true; if (refColItemWidth < this.checkEdit1.Width) refColItemWidth = this.checkEdit1.Width; if (i > 1) { layoutControlGroupQuestion1.AddItem(refColItem, lastItem, DevExpress.XtraLayout.Utils.InsertType.Right); } else { layoutControlGroupQuestion1.AddItem(refColItem); } listItems.Add(refColItem); } else { this.layoutControlItem1 = new LayoutControlItem(); this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0); this.layoutControlItem1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0); //add checkedit this.checkEdit1 = new CheckEdit(); this.checkEdit1.Tag = new MultiplechoiceData() { ParentPositionIndex = "IndexPosition" + x.ToString(), PositionIndex = "IndexPosition" + idx, ControlContainer = layoutControlItem1 }; this.checkEdit1.Text = mcvalueList[idx].TextPrefix; this.checkEdit1.Checked = mcvalueList[idx].Checked; this.checkEdit1.Name = "checkEdit" + Guid.NewGuid().ToString(); this.checkEdit1.StyleController = this.StyleController; checkEdit1.CheckedChanged += new EventHandler(checkEdit1_CheckedChanged); m_DynamicControls.Add(new DynamicControl() { Control = this.checkEdit1, Name = this.checkEdit1.Name, DefaultValue = this.checkEdit1.Checked, TextPrefix = this.checkEdit1.Text }); this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.layoutControlItem1.Control = this.checkEdit1; this.layoutControlItem1.TextVisible = false; this.layoutControlItem1.MinSize = new Size(0, 17); this.layoutControlItem1.MaxSize = new Size(0, 17); this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); if (q > 1 && i==1) { this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1); } else { if ((idx-numRows) >= 0) { this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1, listItems[idx - numRows], DevExpress.XtraLayout.Utils.InsertType.Right); } } listItems.Add(this.layoutControlItem1); prevItem = this.layoutControlItem1; } idx++; } } idx = 0; //EmptySpaceItem esitem = new EmptySpaceItem(); //esitem.Size = new Size(100,20); //this.layoutControlGroupQuestion1.AddItem(esitem); foreach (OtherChoice oChoice in answeroption.OtherChoices) { if (oChoice.Enabled) { //if (!string.IsNullOrEmpty(oChoice.TextPrefix)) { // // simpleLabelItem1 // this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem(); // this.simpleLabelItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString(); // //this.simpleLabelItem1.ShowInCustomizationForm = false; // //this.simpleLabelItem1.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; // this.simpleLabelItem1.Text = oChoice.TextPrefix; // //newSize = new System.Drawing.Size(100, 20); // newSize = new System.Drawing.Size(20, 20); // this.simpleLabelItem1.SizeConstraintsType = SizeConstraintsType.Custom; // this.simpleLabelItem1.MaxSize = newSize; // this.simpleLabelItem1.MinSize = newSize; // this.simpleLabelItem1.Size = newSize; // this.simpleLabelItem1.AppearanceItemCaption.BackColor = System.Drawing.Color.Transparent; // this.simpleLabelItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); // this.layoutControlGroupQuestion1.AddItem(this.simpleLabelItem1); //} else { // this.simpleLabelItem1 = null; //} // layoutControlItem1 this.layoutControlItem1 = new LayoutControlItem(); //add textEdit1 to layout this.memoEdit1 = new MemoEdit(); this.memoEdit1.Tag = new MultiplechoiceData() { ParentPositionIndex = "IndexPosition" + x.ToString(), PositionIndex = "IndexPosition" + idx.ToString(), ControlContainer = layoutControlItem1, Required = oChoice.Required, HasValue = !string.IsNullOrWhiteSpace(oChoice.DefaultInputValue) ? true : false, ChoiceOption = oChoice }; this.memoEdit1.Name = "textEdit" + Guid.NewGuid().ToString(); this.memoEdit1.Properties.ScrollBars = ScrollBars.None; this.memoEdit1.StyleController = this.StyleController; //set value string _DefaultValue = string.Empty; if (oChoice.DefaultInputValue != null) { _DefaultValue = oChoice.DefaultInputValue.Trim(); this.memoEdit1.Text = oChoice.DefaultInputValue.Trim(); oChoice.InputValue = oChoice.DefaultInputValue.Trim(); } m_DynamicControls.Add(new DynamicControl() { Control = this.memoEdit1, Name = this.memoEdit1.Name, DefaultTextValue = _DefaultValue, TextPrefix = oChoice.TextPrefix }); memoEdit1.TextChanged += new EventHandler(textEdit1_TextChanged); memoEdit1.Resize += new EventHandler(memoEdit1_Resize); memoEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.layoutControlItem1.Control = this.memoEdit1; if (!string.IsNullOrEmpty(oChoice.TextPrefix)) { this.layoutControlItem1.Text = oChoice.TextPrefix; this.layoutControlItem1.TextVisible = true; this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top; this.layoutControlItem1.MaxSize = new Size(0, 41); this.layoutControlItem1.MinSize = new Size(0, 41); } else { this.layoutControlItem1.TextVisible = false; this.layoutControlItem1.MaxSize = new Size(0, 24); this.layoutControlItem1.MinSize = new Size(0, 24); } this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1); idx++; } } } //string prioText = oSettings.Priority; //if (oSettings.CustomerOwnership && oSettings.BVOwnership) { // prioText += "(Cust+BV)"; //} else if (oSettings.CustomerOwnership) { // prioText += "(Cust)"; //} else if (oSettings.BVOwnership) { // prioText += "(BV)"; //} //if (oSettings.PlotDoneStatus.Trim().ToLower() == "done") { // prioText += " Done"; //} // simpleLabelItem1 //this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem(); //this.simpleLabelItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString(); //this.simpleLabelItem1.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); //this.simpleLabelItem1.AppearanceItemCaption.Options.UseTextOptions = true; //this.simpleLabelItem1.ShowInCustomizationForm = false; //this.simpleLabelItem1.Text = prioText; //this.simpleLabelItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); //this.layoutControlGroupQuestion1.AddItem(this.simpleLabelItem1); //if (!string.IsNullOrEmpty(oSettings.QuestionHelp)) { // // LabelControl1 help // this.labelControl1 = new DevExpress.XtraEditors.LabelControl(); // this.labelControl1.Name = "labelControl" + Guid.NewGuid().ToString(); // this.labelControl1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); // this.labelControl1.Appearance.Options.UseTextOptions = true; // this.labelControl1.Text = "Help"; // this.labelControl1.ToolTip = oSettings.QuestionHelp.Trim(); // //apply tooltip controller from parent // if (this.ToolTipController != null && this.ToolTipController.DefaultController != null) { // this.labelControl1.ToolTipController = ToolTipController.DefaultController; // } // this.labelControl1.Click += new EventHandler(layoutControlGroupQuestion1_Click); // //layoutControlItem1 // this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); // this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString(); // this.layoutControlItem1.Control = this.labelControl1; // this.layoutControlItem1.TextVisible = false; // this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); // this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1, this.simpleLabelItem1, DevExpress.XtraLayout.Utils.InsertType.Right); //} this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click); /* * https://brightvision.jira.com/browse/PLATFORM-2440 */ for (int i = 0; i < this.layoutControlGroupQuestion1.Items.Count; i++) { ((LayoutControlItem)this.layoutControlGroupQuestion1.Items[i]).ControlMinSize = new Size(refColItemWidth, 17); } this.layoutControlGroupQuestion1.EndUpdate(); Image bg = BGImage(this); if (bg != null) { this.layoutControlGroupQuestion1.BackgroundImage = bg; this.layoutControlGroupQuestion1.BackgroundImageVisible = true; } if (this.memoEdit1 != null) this.BackColor = this.memoEdit1.BackColor; this.ControlGroup = this.layoutControlGroupQuestion1; this.ControlGroup.Tag = this; isLoaded = true; }
void Multiplechoice_Disposed(object sender, EventArgs e) { this.layoutControlGroupQuestion1.Click -= new EventHandler(layoutControlGroupQuestion1_Click); this.OnComponentNotifyChanged = null; ctlFooter.Parent = null; ctlFooter = null; this.ControlGroup.Tag = null; this.ControlGroup = null; this.Parent = null; }
public void BindControls() { if (Questionnaire == null) { BrightVision.Common.UI.NotificationDialog.Information("Drop Box", "Questionnaire must be initialized with Json first."); return; } isLoaded = false; this.layoutControlGroupQuestion1.Clear(); Settings oSettings = Questionnaire.Form.Settings; m_DynamicControls = new List<DynamicControl>(); this.layoutControlGroupQuestion1.Name = "layoutControlGroupQuestion" + Guid.NewGuid().ToString(); this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true; this.layoutControlGroupQuestion1.ExpandButtonVisible = false; this.layoutControlGroupQuestion1.GroupBordersVisible = true; this.layoutControlGroupQuestion1.TextVisible = false; //this.layoutControlGroupQuestion1.Location = new System.Drawing.Point(0, 0); this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1, 1, 1); this.layoutControlGroupQuestion1.ShowInCustomizationForm = false; //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText; this.layoutControlGroupQuestion1.BeginUpdate(); #region Footer this.layoutControlItem1 = new LayoutControlItem(); this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString(); //bool isCustomerOwned = false; //bool isBrightvisionOwned = false; //if (oSettings.CustomerOwnership && oSettings.BVOwnership) // isCustomerOwnershipOnly = true; //ctlFooter = new Footer() { // IsAccountLevel = oSettings.DataBindings.account_level, // IsCustomerOwnershipOnly = isCustomerOwnershipOnly, // HelpText = oSettings.QuestionHelp, // LanguageCode = oSettings.DataBindings.language_code //}; ctlFooter = new Footer() { IsAccountLevel = oSettings.DataBindings.account_level, IsCustomerOwned = oSettings.CustomerOwnership, IsBrightvisionOwned = oSettings.BVOwnership, HelpText = oSettings.QuestionHelp, LanguageCode = oSettings.DataBindings.language_code, QuestionText = String.Format("{0} {1}", oSettings.Label, oSettings.QuestionText) }; ctlFooter.InitializeFooter(); ctlFooter.Dock = DockStyle.Fill; ctlFooter.Height = 20; this.layoutControlItem1.Control = ctlFooter; this.layoutControlItem1.ShowInCustomizationForm = false; this.layoutControlItem1.TextVisible = false; this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlItem1.MinSize = new Size(0, 24); this.layoutControlItem1.MaxSize = new Size(0, 24); this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1); #endregion IList<AnswerOption> answeroptionList = Questionnaire.Form.Settings.AnswerOptions; IDropbox answeroption = null; int iAnswerOptions = answeroptionList.Count; System.Drawing.Size newSize; int selectedIndex = 0; for (int x = 0; x < iAnswerOptions; ++x) { answeroption = answeroptionList[x] as IDropbox; // simpleLabelItem1 this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem(); this.simpleLabelItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString(); this.simpleLabelItem1.ShowInCustomizationForm = false; this.simpleLabelItem1.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; this.simpleLabelItem1.Text = answeroption.TextPrefix; //this.simpleLabelItem1.SizeConstraintsType = SizeConstraintsType.Custom; //this.simpleLabelItem1.MaxSize = new System.Drawing.Size(0, 10); //this.simpleLabelItem1.MinSize = new System.Drawing.Size(5, 10); //this.simpleLabelItem1.Size = new System.Drawing.Size(5, 10); this.simpleLabelItem1.AppearanceItemCaption.BackColor = System.Drawing.Color.Transparent; this.simpleLabelItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.simpleLabelItem1); // layoutControlItem1 this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); // comboBox1 this.comboBoxEdit1 = new ComboBoxEdit(); this.comboBoxEdit1.Tag = new DropboxData() { PositionIndex = "IndexPosition" + x, ControlContainer = layoutControlItem1, Required = answeroption.SelectionValueRequired, HasValue = !string.IsNullOrWhiteSpace(answeroption.DefaultSelectionValue) ? true : false }; this.comboBoxEdit1.Name = "comboBox" + Guid.NewGuid().ToString(); this.comboBoxEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; this.comboBoxEdit1.SelectedIndexChanged += new EventHandler(comboBoxEdit1_SelectedIndexChanged); this.comboBoxEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click); List<string> dropboxvalues = answeroption.DropBoxValues; var colItems = this.comboBoxEdit1.Properties.Items; dropboxvalues.ForEach(delegate(string value) { colItems.Add(value); }); if (answeroption.DefaultSelectionValue != null) { selectedIndex = dropboxvalues.IndexOf(answeroption.DefaultSelectionValue.Trim()); answeroption.SelectionValue = answeroption.DefaultSelectionValue.Trim(); } m_DynamicControls.Add(new DynamicControl() { Control = this.comboBoxEdit1, Name = this.comboBoxEdit1.Name, DefaultValue = selectedIndex.ToString(), TextPrefix = answeroption.TextPrefix }); this.comboBoxEdit1.SelectedIndex = selectedIndex; this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.layoutControlItem1.Control = this.comboBoxEdit1; //this.layoutControlItem1.MinSize = new Size(150, 24); //this.layoutControlItem1.MaxSize = new Size(250, 24); //if (!string.IsNullOrEmpty(answeroption.DropboxMaxWidth)) { // newSize = new System.Drawing.Size(int.Parse(answeroption.DropboxMaxWidth), 24); // this.layoutControlItem1.Size = newSize; //} else { // this.layoutControlItem1.Size = new Size(80, 24); //} if (answeroption.SelectionValueIfOtherVisible) { this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlItem1.MaxSize = new Size(150, 24); this.layoutControlItem1.MinSize = new Size(80, 24); } //else { // this.layoutControlItem1.MaxSize = new Size(0, 24); // this.layoutControlItem1.MinSize = new Size(0, 24); //} //if (!string.IsNullOrEmpty(answeroption.TextPrefix)) { // this.layoutControlItem1.Text = answeroption.TextPrefix; // this.layoutControlItem1.TextVisible = true; // this.layoutControlItem1.AppearanceItemCaption.TextOptions.HAlignment = HorzAlignment.Far; //} else { // this.layoutControlItem1.TextVisible = false; //} this.layoutControlItem1.TextVisible = false; this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1, this.simpleLabelItem1, DevExpress.XtraLayout.Utils.InsertType.Right); if (answeroption.SelectionValueIfOtherVisible) { // layoutControlItem2 this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); //add textEdit1 to layout this.textEdit1 = new TextEdit(); this.textEdit1.Tag = new DropboxData() { PositionIndex = "IndexPosition" + x, ControlContainer = layoutControlItem2, Required = answeroption.SelectionValueIfOtherRequired, HasValue = (!string.IsNullOrWhiteSpace(answeroption.DefaultSelectionValueIfOther) ? true : false) }; this.textEdit1.Name = "textEdit" + Guid.NewGuid().ToString(); this.textEdit1.StyleController = this.StyleController; textEdit1.TextChanged += new EventHandler(textEdit1_TextChanged); textEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click); //if (!string.IsNullOrEmpty(answeroption.DefaultSelectionValueIfOther)) { // this.textEdit1.Text = answeroption.DefaultSelectionValueIfOther.Trim(); //}else if (!string.IsNullOrEmpty(answeroption.SelectionValueIfOther)) { // this.textEdit1.Text = answeroption.SelectionValueIfOther.Trim(); //} string _DefaultValue = string.Empty; if (answeroption.DefaultSelectionValueIfOther != null) { _DefaultValue = answeroption.DefaultSelectionValueIfOther.Trim(); this.textEdit1.Text = answeroption.DefaultSelectionValueIfOther.Trim(); answeroption.SelectionValueIfOther = this.textEdit1.Text; } m_DynamicControls.Add(new DynamicControl() { Control = this.textEdit1, Name = this.textEdit1.Name, DefaultValue = _DefaultValue, TextPrefix = answeroption.TextPrefix }); this.layoutControlItem2.SizeConstraintsType = SizeConstraintsType.Custom; newSize = new System.Drawing.Size(350, 24); this.layoutControlItem2.Size = newSize; this.layoutControlItem2.MaxSize = new Size(350, 24); this.layoutControlItem2.MinSize = new Size(150, 24); //this.layoutControlItem2.SizeConstraintsType = SizeConstraintsType.Custom; //this.layoutControlItem2.MaxSize = new Size(250, 24); this.layoutControlItem2.Control = this.textEdit1; this.layoutControlItem2.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.layoutControlItem2.TextToControlDistance = 0; this.layoutControlItem2.TextVisible = false; this.layoutControlItem2.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem2, this.layoutControlItem1, DevExpress.XtraLayout.Utils.InsertType.Right); } } //string prioText = oSettings.Priority; //if (oSettings.CustomerOwnership && oSettings.BVOwnership) { // prioText += "(Cust+BV)"; //} else if (oSettings.CustomerOwnership) { // prioText += "(Cust)"; //} else if (oSettings.BVOwnership) { // prioText += "(BV)"; //} //if (oSettings.PlotDoneStatus.Trim().ToLower() == "done") { // prioText += " Done"; //} //// simpleLabelItem1 status //this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); //this.emptySpaceItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString(); //this.emptySpaceItem1.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); //this.emptySpaceItem1.AppearanceItemCaption.Options.UseTextOptions = true; //this.emptySpaceItem1.ShowInCustomizationForm = false; //this.emptySpaceItem1.SizeConstraintsType = SizeConstraintsType.Custom; //this.emptySpaceItem1.Text = prioText; //this.emptySpaceItem1.TextVisible = true; //this.emptySpaceItem1.Size = new Size(10, 20); //this.emptySpaceItem1.MaxSize = new Size(0, 20); //this.emptySpaceItem1.MinSize = new Size(0, 20); //this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); //this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1); //if (!string.IsNullOrEmpty(oSettings.QuestionHelp)) { // this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem(); // this.emptySpaceItem2.Name = "simpleLabelItem" + Guid.NewGuid().ToString(); // this.emptySpaceItem2.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); // this.emptySpaceItem2.AppearanceItemCaption.Options.UseTextOptions = true; // this.emptySpaceItem2.ShowInCustomizationForm = false; // this.emptySpaceItem2.Text = "Help"; // this.emptySpaceItem2.OptionsToolTip.ToolTip = oSettings.QuestionHelp.Trim(); // //apply tooltip controller from parent // //if (this.ToolTipController != null && this.ToolTipController.DefaultController != null) { // // this.emptySpaceItem2.OptionsToolTip.ToolTipController = ToolTipController.DefaultController; // //} // this.emptySpaceItem2.TextVisible = true; // this.emptySpaceItem2.Size = new Size(50, 20); // this.emptySpaceItem2.MaxSize = new Size(50, 20); // this.emptySpaceItem2.MinSize = new Size(50, 20); // this.emptySpaceItem2.SizeConstraintsType = SizeConstraintsType.Custom; // this.emptySpaceItem2.Click += new EventHandler(layoutControlGroupQuestion1_Click); // this.emptySpaceItem2.AppearanceItemCaption.TextOptions.HAlignment = HorzAlignment.Far; // this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem2, this.emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Right); //} this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.EndUpdate(); Image bg = BGImage(this); if (bg != null) { this.layoutControlGroupQuestion1.BackgroundImage = bg; this.layoutControlGroupQuestion1.BackgroundImageVisible = true; } if (this.textEdit1 != null) BackColor = this.textEdit1.BackColor; this.ControlGroup = this.layoutControlGroupQuestion1; this.ControlGroup.Tag = this; isLoaded = true; }
/* * https://brightvision.jira.com/browse/PLATFORM-3015 */ public void BindControls() { #region Initialization if (Questionnaire == null) MessageBox.Show("Questionnaire must be bind with JSON first.", "Schedule Component"); var answerOpt = Questionnaire.Form.Settings.AnswerOptions[0] as ISchedule; //if (CalendarDataSource == null) { // if (answerOpt != null) { // if (answerOpt.CalendarOption != null && answerOpt.CalendarOption.CalendarValues.Count > 0) // CalendarDataSource = answerOpt.CalendarOption.CalendarValues; // else { // MessageBox.Show("\"CalendarDataSource\" property must be set first.","Schedule Component"); // return; // } // } else { // MessageBox.Show("\"CalendarDataSource\" property must be set first.", "Schedule Component"); // return; // } //} #endregion isLoaded = false; this.layoutControlGroupQuestion1.Clear(); Settings oSettings = Questionnaire.Form.Settings; // layoutControlGroupQuestion1 this.layoutControlGroupQuestion1.Name = "layoutControlGroupQuestion" + Guid.NewGuid().ToString(); this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true; this.layoutControlGroupQuestion1.ExpandButtonVisible = false; this.layoutControlGroupQuestion1.GroupBordersVisible = true; this.layoutControlGroupQuestion1.TextVisible = false; this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1, 1, 1); this.layoutControlGroupQuestion1.ShowInCustomizationForm = false; //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText; this.layoutControlGroupQuestion1.BeginUpdate(); #region Footer this.lciFooter = new LayoutControlItem(); this.lciFooter.Name = "layoutControlItem" + Guid.NewGuid().ToString(); //bool isCustomerOwnershipOnly = false; //if (oSettings.CustomerOwnership && oSettings.BVOwnership) // isCustomerOwnershipOnly = true; //ctlFooter = new Footer() { // IsAccountLevel = oSettings.DataBindings.account_level, // IsCustomerOwnershipOnly = isCustomerOwnershipOnly, // HelpText = oSettings.QuestionHelp, // LanguageCode = oSettings.DataBindings.language_code //}; ctlFooter = new Footer() { IsAccountLevel = oSettings.DataBindings.account_level, IsCustomerOwned = oSettings.CustomerOwnership, IsBrightvisionOwned = oSettings.BVOwnership, HelpText = oSettings.QuestionHelp, LanguageCode = oSettings.DataBindings.language_code, QuestionText = oSettings.Label + " " + oSettings.QuestionText }; ctlFooter.InitializeFooter(); ctlFooter.Dock = DockStyle.Fill; ctlFooter.Height = 20; this.lciFooter.Control = ctlFooter; this.lciFooter.ShowInCustomizationForm = false; this.lciFooter.TextVisible = false; this.lciFooter.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.lciFooter.MinSize = new Size(0, 24); this.lciFooter.MaxSize = new Size(0, 24); this.lciFooter.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.lciFooter.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlGroupQuestion1.AddItem(this.lciFooter); #endregion IList<AnswerOption> answeroptionList = Questionnaire.Form.Settings.AnswerOptions; ISchedule answeroption = null; int iAnswerOptions = answeroptionList.Count; //System.Drawing.Size newSize; int idx = 0; ScheduleSalesPerson oSalesPerson; for (int x = 0; x < iAnswerOptions; ++x) { answeroption = answeroptionList[x] as ISchedule; LayoutControlItem lciScheduleDetails = new LayoutControlItem(); this.lblScheduleDetails = new Label(); this.lblScheduleDetails.Text = ""; lciScheduleDetails.Control = this.lblScheduleDetails; lciScheduleDetails.TextVisible = false; this.layoutControlGroupQuestion1.AddItem(lciScheduleDetails); #region Sales Person // layoutControlItem1 this.lciSalesPerson = new LayoutControlItem(); //lookUpEdit1 this.lookUpEdit1 = new LookUpEdit(); this.lookUpEdit1.Name = "SalesPerson_lookUpEdit" + Guid.NewGuid().ToString(); this.lookUpEdit1.Properties.NullText = ""; //this.lookUpEdit1.Properties.DisplayMember = "Name"; //this.lookUpEdit1.Properties.ValueMember = "Id"; this.lookUpEdit1.Properties.DisplayMember = "resource_name"; this.lookUpEdit1.Properties.ValueMember = "resource_id"; //this.lookUpEdit1.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "SalesPerson")); this.lookUpEdit1.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("resource_name", "SalesPerson")); this.lookUpEdit1.Properties.ShowFooter = false; this.lookUpEdit1.Properties.ShowHeader = false; this.lookUpEdit1.Properties.ReadOnly = true; this.lookUpEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; oSalesPerson = answeroption.ScheduleSalesPerson; if (oSalesPerson != null) { if (oSalesPerson.SalesPersonSelectedValue != null) { this.lookUpEdit1.Properties.DataSource = new List<SalesPerson> { oSalesPerson.SalesPersonSelectedValue }; this.lookUpEdit1.EditValue = oSalesPerson.SalesPersonSelectedValue.Id; } } this.lookUpEdit1.Tag = new ScheduleData() { Name = "SalesPerson", PositionIndex = "IndexPosition" + x, ControlContainer = lciSalesPerson }; this.lookUpEdit1.Size = new System.Drawing.Size(155, 20); this.lookUpEdit1.StyleController = this.StyleController; //this.lookUpEdit1.EditValueChanged += new EventHandler(lookUpEdit1_SelectedIndexChanged); this.lookUpEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click); // lciSalesPerson this.lciSalesPerson.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.lciSalesPerson.Control = this.lookUpEdit1; if (oSalesPerson != null && !string.IsNullOrEmpty(oSalesPerson.TextPrefix)) { this.lciSalesPerson.Text = oSalesPerson.TextPrefix.Trim(); } else { this.lciSalesPerson.Text = "Sales Person:"; } this.lciSalesPerson.TextLocation = DevExpress.Utils.Locations.Top; this.lciSalesPerson.TextSize = new System.Drawing.Size(108, 13); this.lciSalesPerson.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.lciSalesPerson.MaxSize = new System.Drawing.Size(160, 20); this.lciSalesPerson.MinSize = new System.Drawing.Size(160, 20); this.lciSalesPerson.Size = new System.Drawing.Size(50, 20); this.lciSalesPerson.ShowInCustomizationForm = false; this.lciSalesPerson.Click += new EventHandler(layoutControlGroupQuestion1_Click); //this.layoutControlGroupQuestion1.AddItem(this.lciSalesPerson); #endregion #region Schedule Type // emptySpaceItem1 this.emptySpaceItem1 = new EmptySpaceItem(); this.emptySpaceItem1.Name = "emptySpaceItem" + Guid.NewGuid().ToString(); this.emptySpaceItem1.Size = new System.Drawing.Size(25, 20); this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.emptySpaceItem1.MaxSize = new System.Drawing.Size(0, 20); this.emptySpaceItem1.MinSize = new System.Drawing.Size(0, 20); this.emptySpaceItem1.ShowInCustomizationForm = false; this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); // // comboBoxEdit1 this.lciScheduleType = new DevExpress.XtraLayout.LayoutControlItem(); this.comboBoxEdit1 = new ComboBoxEdit(); this.comboBoxEdit1.Tag = new ScheduleData() { Name = "ScheduleType", PositionIndex = "IndexPosition" + x, ControlContainer = lciScheduleType }; this.comboBoxEdit1.Size = new System.Drawing.Size(50, 20); this.comboBoxEdit1.Name = "ScheduleType_comboBoxEdit" + Guid.NewGuid().ToString(); this.comboBoxEdit1.Properties.ReadOnly = true; this.comboBoxEdit1.StyleController = this.StyleController; this.comboBoxEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; this.comboBoxEdit1.SelectedIndexChanged += new EventHandler(comboBoxEdit1_SelectedIndexChanged); this.comboBoxEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click); if (answeroption.ScheduleType == null) { answeroption.ScheduleType = new ScheduleType(); } if (answeroption.ScheduleType.ScheduleTypeSelectedValue == null) { answeroption.ScheduleType.ScheduleTypeSelectedValue = ""; } answeroption.ScheduleType.ScheduleTypeValues = new List<string> { "Seminar", "Webinar", "Meeting" }; answeroption.ScheduleType.ScheduleTypeValues.ForEach(delegate(string strValue) { this.comboBoxEdit1.Properties.Items.Add(strValue); }); // lciScheduleType this.lciScheduleType.Name = "layoutControlItem" + Guid.NewGuid().ToString(); //this.layoutControlItem2.AppearanceItemCaption.Options.UseTextOptions = true; //this.layoutControlItem2.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; this.lciScheduleType.Control = this.comboBoxEdit1; this.lciScheduleType.TextLocation = DevExpress.Utils.Locations.Top; this.lciScheduleType.TextSize = new System.Drawing.Size(60, 13); if (!string.IsNullOrEmpty(answeroption.ScheduleType.TextPrefix)) { this.lciScheduleType.Text = answeroption.ScheduleType.TextPrefix; } else { this.lciScheduleType.Text = "Schedule Type:"; } this.lciScheduleType.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.lciScheduleType.MaxSize = new System.Drawing.Size(160, 24); this.lciScheduleType.MinSize = new System.Drawing.Size(160, 24); this.lciScheduleType.Size = new System.Drawing.Size(160, 24); this.lciScheduleType.ShowInCustomizationForm = false; this.lciScheduleType.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.lciSalesPerson.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization; this.lciScheduleType.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization; this.emptySpaceItem1.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization; this.layoutControlGroupQuestion1.AddItem(this.lciScheduleType); this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1, this.lciScheduleType, DevExpress.XtraLayout.Utils.InsertType.Right); this.layoutControlGroupQuestion1.AddItem(this.lciSalesPerson, this.emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Right); // emptySpaceItem1 this.emptySpaceItem1 = new EmptySpaceItem(); this.emptySpaceItem1.Name = "emptySpaceItem" + Guid.NewGuid().ToString(); this.emptySpaceItem1.Size = new System.Drawing.Size(1, 15); this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.emptySpaceItem1.MaxSize = new System.Drawing.Size(0, 15); this.emptySpaceItem1.MinSize = new System.Drawing.Size(0, 15); this.emptySpaceItem1.ShowInCustomizationForm = false; this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); //this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1); #endregion #region List of Schedules Available // lciListOfSchedule this.lciListOfScheduleDropDown = new DevExpress.XtraLayout.LayoutControlItem(); //lookUpEdit1 this.lookUpEdit2 = new LookUpEdit(); this.lookUpEdit2.Name = "lookUpEdit" + Guid.NewGuid().ToString(); this.lookUpEdit2.Properties.NullText = ""; this.lookUpEdit2.Properties.DisplayMember = "title"; this.lookUpEdit2.Properties.ValueMember = "id"; this.lookUpEdit2.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("title", "List of Bookings")); comboBoxEdit1_SelectedIndexChanged(this.comboBoxEdit1, null); this.lookUpEdit2.Properties.ShowFooter = true; this.lookUpEdit2.Properties.ShowHeader = false; this.lookUpEdit2.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; this.lookUpEdit2.Tag = new ScheduleData() { Name = "ListOfBookingsAvailable", PositionIndex = "IndexPosition" + x, ControlContainer = lciListOfScheduleDropDown, Required = answeroption.ListOfBookingsAvailableRequired, HasValue = answeroption.ScheduleValue != null && !string.IsNullOrEmpty(answeroption.ScheduleValue.ScheduleId) ? true : false }; this.lookUpEdit2.Size = new System.Drawing.Size(155, 20); this.lookUpEdit2.StyleController = this.StyleController; //load answer values if (answeroption.ScheduleType != null) { if (answeroption.ScheduleValue != null) { if (!string.IsNullOrEmpty(answeroption.ScheduleValue.ScheduleId)) { int schedid = int.Parse(answeroption.ScheduleValue.ScheduleId); lookUpEdit2.EditValue = schedid; //if (answeroption.ScheduleType.ScheduleTypeSelectedValue.ToLower() == "meeting") { // CreateMeeting.Enabled = true; //} } } } //this.lookUpEdit2.EditValueChanged += new EventHandler(lookUpEdit2_EditValueChanged); this.lookUpEdit2.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.comboBoxEdit1.EditValue = answeroption.ScheduleType.ScheduleTypeSelectedValue; // layoutControlItem1 this.lciListOfScheduleDropDown.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.lciListOfScheduleDropDown.Control = this.lookUpEdit2; if (!string.IsNullOrEmpty(answeroption.ListOfBookingsAvailableLabel)) { this.lciListOfScheduleDropDown.Text = answeroption.ListOfBookingsAvailableLabel.Trim(); } else { this.lciListOfScheduleDropDown.Text = "List of Schedules Available:"; } this.lciListOfScheduleDropDown.TextLocation = DevExpress.Utils.Locations.Top; this.lciListOfScheduleDropDown.ShowInCustomizationForm = false; this.lciListOfScheduleDropDown.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.lciListOfScheduleDropDown.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization; this.layoutControlGroupQuestion1.AddItem(this.lciListOfScheduleDropDown); // // simpleButton1 // this.PreviewBooking = new SimpleButton(); //this.PreviewBooking.Name = "PreviewDetails_simpleButton" + Guid.NewGuid().ToString(); this.PreviewBooking.Name = "PreviewBooking"; this.PreviewBooking.Size = new System.Drawing.Size(130, 22); this.PreviewBooking.StyleController = this.StyleController; if (!string.IsNullOrEmpty(answeroption.ViewDetailSummaryButtonLabel)) this.PreviewBooking.Text = answeroption.ViewDetailSummaryButtonLabel; else this.PreviewBooking.Text = "Preview Details"; this.PreviewBooking.Click += new EventHandler(viewDetailSummary_Click); this.PreviewBooking.Enabled = false; // lciListOfSchedulePreviewButton this.lciListOfSchedulePreviewButton = new LayoutControlItem(); this.lciListOfSchedulePreviewButton.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.lciListOfSchedulePreviewButton.Control = this.PreviewBooking; this.lciListOfSchedulePreviewButton.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.lciListOfSchedulePreviewButton.MaxSize = new System.Drawing.Size(100, 24); this.lciListOfSchedulePreviewButton.MinSize = new System.Drawing.Size(80, 24); this.lciListOfSchedulePreviewButton.Size = new System.Drawing.Size(80, 24); this.lciListOfSchedulePreviewButton.TextVisible = false; this.lciListOfSchedulePreviewButton.ShowInCustomizationForm = false; this.lciListOfSchedulePreviewButton.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.lciListOfSchedulePreviewButton); // // simpleButton1 // this.CreateMeeting = new SimpleButton(); //this.CreateMeeting.Name = "CreateMeeting_simpleButton" + Guid.NewGuid().ToString(); this.CreateMeeting.Name = "CreateMeeting"; this.CreateMeeting.Size = new System.Drawing.Size(130, 22); this.CreateMeeting.StyleController = this.StyleController; if (!string.IsNullOrEmpty(answeroption.CreateMeetingButtonLabel)) { if (answeroption.CreateMeetingButtonLabel.Trim().ToLower() == "create meeting") { this.CreateMeeting.Text = "Create/Edit Meeting"; } else { this.CreateMeeting.Text = answeroption.CreateMeetingButtonLabel; } } else { this.CreateMeeting.Text = "Create/Edit Meeting"; } this.CreateMeeting.Click += new EventHandler(createMeeting_Click); this.CreateMeeting.Enabled = false; // layoutControlItem1 this.lciListOfScheduleCreateEditButton = new LayoutControlItem(); if (answeroption.ScheduleType != null && answeroption.ScheduleType.ScheduleTypeSelectedValue == "Meeting") { //lookUpEdit2.Properties.ReadOnly = true; this.CreateMeeting.Tag = "HasMeeting"; } else this.lciListOfScheduleCreateEditButton.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; //this.lciListOfScheduleCreateEditButton.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.lciListOfScheduleCreateEditButton.Name = "lciListOfScheduleCreateEditButton"; this.lciListOfScheduleCreateEditButton.Control = this.CreateMeeting; this.lciListOfScheduleCreateEditButton.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.lciListOfScheduleCreateEditButton.MaxSize = new System.Drawing.Size(115, 24); this.lciListOfScheduleCreateEditButton.MinSize = new System.Drawing.Size(115, 24); this.lciListOfScheduleCreateEditButton.Size = new System.Drawing.Size(115, 24); this.lciListOfScheduleCreateEditButton.TextVisible = false; this.lciListOfScheduleCreateEditButton.ShowInCustomizationForm = false; this.lciListOfScheduleCreateEditButton.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.lciListOfScheduleCreateEditButton, this.lciListOfSchedulePreviewButton, DevExpress.XtraLayout.Utils.InsertType.Right); // // simpleButton1 // this.DeleteMeeting = new SimpleButton(); //this.DeleteMeeting.Name = "DeleteMeeting_simpleButton" + Guid.NewGuid().ToString(); this.DeleteMeeting.Name = "DeleteMeeting"; this.DeleteMeeting.Size = new System.Drawing.Size(130, 22); this.DeleteMeeting.StyleController = this.StyleController; this.DeleteMeeting.Text = "Delete Meeting"; this.DeleteMeeting.Click += new EventHandler(deleteMeeting_Click); this.DeleteMeeting.Enabled = false; // lciListOfScheduleDeleteButton this.lciListOfScheduleDeleteButton = new LayoutControlItem(); if (answeroption.ScheduleType != null && answeroption.ScheduleType.ScheduleTypeSelectedValue == "Meeting") { this.DeleteMeeting.Tag = "HasMeeting"; //lookUpEdit2.Properties.ReadOnly = true; var lueData = lookUpEdit2.Tag as ScheduleData; lueData.IsMeeting = true; } else this.lciListOfScheduleDeleteButton.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; this.lciListOfScheduleDeleteButton.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.lciListOfScheduleDeleteButton.Control = this.DeleteMeeting; this.lciListOfScheduleDeleteButton.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.lciListOfScheduleDeleteButton.MaxSize = new System.Drawing.Size(100, 24); this.lciListOfScheduleDeleteButton.MinSize = new System.Drawing.Size(80, 24); this.lciListOfScheduleDeleteButton.Size = new System.Drawing.Size(80, 24); this.lciListOfScheduleDeleteButton.TextVisible = false; this.lciListOfScheduleDeleteButton.ShowInCustomizationForm = false; this.lciListOfScheduleDeleteButton.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.lciListOfScheduleDeleteButton, this.lciListOfScheduleCreateEditButton, DevExpress.XtraLayout.Utils.InsertType.Right); ////load answer values //if (answeroption.ScheduleType != null) { // if (answeroption.ScheduleValue != null) { // if (!string.IsNullOrEmpty(answeroption.ScheduleValue.ScheduleId)) { // int schedid = int.Parse(answeroption.ScheduleValue.ScheduleId); // lookUpEdit2.EditValue = schedid; // //if (answeroption.ScheduleType.ScheduleTypeSelectedValue.ToLower() == "meeting") { // // CreateMeeting.Enabled = true; // //} // } // } //} // emptySpaceItem1 this.emptySpaceItem1 = new EmptySpaceItem(); this.emptySpaceItem1.Name = "emptySpaceItem" + Guid.NewGuid().ToString(); this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.emptySpaceItem1.MaxSize = new System.Drawing.Size(0, 20); this.emptySpaceItem1.MinSize = new System.Drawing.Size(0, 20); this.emptySpaceItem1.Size = new System.Drawing.Size(200, 20); this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); this.emptySpaceItem1.ShowInCustomizationForm = false; this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1, this.lciListOfScheduleDeleteButton, DevExpress.XtraLayout.Utils.InsertType.Right); #endregion #region Customer Attendies #region Grid simpleLabelItemValidation = new SimpleLabelItem(); simpleLabelItemValidation.AppearanceItemCaption.BackColor = Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); simpleLabelItemValidation.Name = Guid.NewGuid().ToString(); simpleLabelItemValidation.TextAlignMode = TextAlignModeItem.CustomSize; simpleLabelItemValidation.TextSize = new Size(212, 20); simpleLabelItemValidation.Text = " Please add at least one contact attendie."; simpleLabelItemValidation.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; this.layoutControlGroupQuestion1.AddItem(simpleLabelItemValidation); //create our gridcontrol // // gridColumn1 // this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn1.Caption = "Name"; this.gridColumn1.FieldName = "Name"; this.gridColumn1.Name = "gridColumn" + Guid.NewGuid().ToString(); this.gridColumn1.Visible = true; this.gridColumn1.OptionsColumn.AllowEdit = false; this.gridColumn1.VisibleIndex = 0; this.gridColumn1.Width = 66; // // gridColumn2 // this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn2.Caption = "Address"; this.gridColumn2.FieldName = "Address"; this.gridColumn2.Name = "gridColumn" + Guid.NewGuid().ToString(); this.gridColumn2.Visible = true; this.gridColumn2.OptionsColumn.AllowEdit = false; this.gridColumn2.VisibleIndex = 1; this.gridColumn2.Width = 66; // // gridColumn3 // //this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn(); //this.gridColumn3.Caption = "City"; //this.gridColumn3.FieldName = "City"; //this.gridColumn3.Name = "gridColumn" + Guid.NewGuid().ToString(); //this.gridColumn3.Visible = true; //this.gridColumn3.OptionsColumn.AllowEdit = false; //this.gridColumn3.VisibleIndex = 2; //this.gridColumn3.Width = 66; // // gridColumn4 // this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn4.Caption = "Telephone"; this.gridColumn4.FieldName = "Telephone"; this.gridColumn4.Name = "gridColumn" + Guid.NewGuid().ToString(); this.gridColumn4.Visible = true; this.gridColumn4.OptionsColumn.AllowEdit = false; this.gridColumn4.VisibleIndex = 3; this.gridColumn4.Width = 66; // // gridColumn5 // this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn5.Caption = "Email"; this.gridColumn5.FieldName = "Email"; this.gridColumn5.Name = "gridColumn" + Guid.NewGuid().ToString(); this.gridColumn5.Visible = true; this.gridColumn5.OptionsColumn.AllowEdit = false; this.gridColumn5.VisibleIndex = 4; this.gridColumn5.Width = 70; // // gridColumn6 // this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn6.Caption = "AccountID"; this.gridColumn6.FieldName = "AccountID"; this.gridColumn6.Name = "gridColumn" + Guid.NewGuid().ToString(); this.gridColumn6.Visible = false; // // gridColumn7 // this.gridColumn7 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn7.Caption = "ContactID"; this.gridColumn7.FieldName = "ContactID"; this.gridColumn7.Name = "gridColumn" + Guid.NewGuid().ToString(); this.gridColumn7.Visible = false; // // gridView1 // this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { this.gridColumn1, this.gridColumn2, //this.gridColumn3, this.gridColumn4, this.gridColumn5, this.gridColumn6, this.gridColumn7}); this.gridView1.GridControl = this.gridControl1; this.gridView1.Name = "gridView" + Guid.NewGuid().ToString(); this.gridView1.OptionsFind.AlwaysVisible = false; this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false; this.gridView1.OptionsSelection.MultiSelect = true; this.gridView1.OptionsView.ShowGroupPanel = false; this.gridView1.OptionsView.ColumnAutoWidth = true; this.gridView1.DataSourceChanged += new EventHandler(gridView1_DataSourceChanged); // // gridControl1 // this.gridControl1 = new DevExpress.XtraGrid.GridControl(); this.gridControl1.LookAndFeel.UseDefaultLookAndFeel = false; this.gridControl1.MainView = this.gridView1; this.gridControl1.Name = "gridControl" + Guid.NewGuid().ToString(); this.gridControl1.Size = new System.Drawing.Size(150, 74); this.gridControl1.TabIndex = 11; this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView1}); SetCurrentAttendies(); var schedData = new ScheduleData() { Required = answeroption.AttendiesRequired }; if (gridView1.GridControl.DataSource != null) { List<ContactAttendie> gvDs = gridView1.GridControl.DataSource as List<ContactAttendie>; if (gvDs != null && gvDs.Count > 0) schedData.HasValue = true; } this.gridView1.Tag = schedData; // // lciGridControl // this.lciGridControl = new LayoutControlItem(); this.lciGridControl.Control = this.gridControl1; this.lciGridControl.Name = "layoutControlItem" + Guid.NewGuid().ToString(); if (!string.IsNullOrEmpty(answeroption.AttendiesLabel)) this.lciGridControl.Text = answeroption.AttendiesLabel; else this.lciGridControl.Text = "Attendies:"; this.lciGridControl.TextLocation = DevExpress.Utils.Locations.Top; this.lciGridControl.TextSize = new System.Drawing.Size(108, 13); this.lciGridControl.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.lciGridControl.MaxSize = new System.Drawing.Size(0, 90); this.lciGridControl.MinSize = new System.Drawing.Size(0, 90); this.lciGridControl.Size = new System.Drawing.Size(200, 90); this.lciGridControl.ShowInCustomizationForm = false; this.layoutControlGroupQuestion1.AddItem(this.lciGridControl); #endregion // // simpleButton1 // this.simpleButton1 = new SimpleButton(); this.simpleButton1.Name = "simpleButton" + Guid.NewGuid().ToString(); this.simpleButton1.Size = new System.Drawing.Size(130, 22); this.simpleButton1.StyleController = this.StyleController; this.simpleButton1.Enabled = false; if (!string.IsNullOrEmpty(answeroption.AddCallerButtonLabel)) this.simpleButton1.Text = answeroption.AddCallerButtonLabel; else this.simpleButton1.Text = "Add Caller"; this.simpleButton1.Click += new EventHandler(AddCaller_Click); // lciAddCaller this.lciAddCaller = new LayoutControlItem(); this.lciAddCaller.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.lciAddCaller.Control = this.simpleButton1; this.lciAddCaller.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.lciAddCaller.MaxSize = new System.Drawing.Size(80, 24); this.lciAddCaller.MinSize = new System.Drawing.Size(80, 24); this.lciAddCaller.Size = new System.Drawing.Size(80, 24); this.lciAddCaller.TextVisible = false; this.lciAddCaller.ShowInCustomizationForm = false; this.lciAddCaller.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.lciAddCaller); // // simpleButton2 // this.simpleButton2 = new SimpleButton(); this.simpleButton2.Name = "simpleButton" + Guid.NewGuid().ToString(); this.simpleButton2.Size = new System.Drawing.Size(130, 22); this.simpleButton2.StyleController = this.StyleController; this.simpleButton2.Enabled = false; if (!string.IsNullOrEmpty(answeroption.AddAdditionalAttendieButtonLabel)) this.simpleButton2.Text = answeroption.AddAdditionalAttendieButtonLabel; else this.simpleButton2.Text = "Add Additional"; this.simpleButton2.Click += new EventHandler(AddAdditional_Click); // layoutControlItem1 this.lciAddAdditional = new LayoutControlItem(); this.lciAddAdditional.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.lciAddAdditional.Control = this.simpleButton2; this.lciAddAdditional.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.lciAddAdditional.MaxSize = new System.Drawing.Size(100, 24); this.lciAddAdditional.MinSize = new System.Drawing.Size(80, 24); this.lciAddAdditional.Size = new System.Drawing.Size(80, 24); this.lciAddAdditional.TextVisible = false; this.lciAddAdditional.ShowInCustomizationForm = false; this.lciAddAdditional.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.lciAddAdditional, this.lciAddCaller, DevExpress.XtraLayout.Utils.InsertType.Right); // // simpleButton3 // this.simpleButton3 = new SimpleButton(); this.simpleButton3.Name = "simpleButton" + Guid.NewGuid().ToString(); this.simpleButton3.Size = new System.Drawing.Size(130, 22); this.simpleButton3.StyleController = this.StyleController; this.simpleButton3.Enabled = false; if (!string.IsNullOrEmpty(answeroption.DeleteAttendieButtonLabel)) this.simpleButton3.Text = answeroption.DeleteAttendieButtonLabel; else this.simpleButton3.Text = "Delete"; this.simpleButton3.Click += new EventHandler(DeleteAttendie_Click); // layoutControlItem2 this.lciDeleteCaller = new LayoutControlItem(); this.lciDeleteCaller.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.lciDeleteCaller.Control = this.simpleButton3; this.lciDeleteCaller.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.lciDeleteCaller.MaxSize = new System.Drawing.Size(70, 24); this.lciDeleteCaller.MinSize = new System.Drawing.Size(70, 24); this.lciDeleteCaller.Size = new System.Drawing.Size(70, 24); this.lciDeleteCaller.TextVisible = false; this.lciDeleteCaller.ShowInCustomizationForm = false; this.lciDeleteCaller.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.lciDeleteCaller, this.lciAddAdditional, DevExpress.XtraLayout.Utils.InsertType.Right); // emptySpaceItem1 this.emptySpaceItem1 = new EmptySpaceItem(); this.emptySpaceItem1.Name = "emptySpaceItem" + Guid.NewGuid().ToString(); this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.emptySpaceItem1.MaxSize = new System.Drawing.Size(0, 20); this.emptySpaceItem1.MinSize = new System.Drawing.Size(0, 20); this.emptySpaceItem1.Size = new System.Drawing.Size(200, 20); this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); this.emptySpaceItem1.ShowInCustomizationForm = false; this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1, this.lciDeleteCaller, DevExpress.XtraLayout.Utils.InsertType.Right); #endregion #region Other Choices idx = 0; //EmptySpaceItem esitem = new EmptySpaceItem(); //esitem.Size = new Size(100, 20); //this.layoutControlGroupQuestion1.AddItem(esitem); foreach (OtherChoice oChoice in answeroption.OtherChoices) { if (oChoice.Enabled) { //if (!string.IsNullOrEmpty(oChoice.TextPrefix)) { // // simpleLabelItem1 // this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem(); // this.simpleLabelItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString(); // //this.simpleLabelItem1.ShowInCustomizationForm = false; // //this.simpleLabelItem1.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; // this.simpleLabelItem1.Text = oChoice.TextPrefix; // //newSize = new System.Drawing.Size(100, 20); // newSize = new System.Drawing.Size(20, 20); // this.simpleLabelItem1.SizeConstraintsType = SizeConstraintsType.Custom; // this.simpleLabelItem1.MaxSize = newSize; // this.simpleLabelItem1.MinSize = newSize; // this.simpleLabelItem1.Size = newSize; // this.simpleLabelItem1.AppearanceItemCaption.BackColor = System.Drawing.Color.Transparent; // this.simpleLabelItem1.ShowInCustomizationForm = false; // this.simpleLabelItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); // this.layoutControlGroupQuestion1.AddItem(this.simpleLabelItem1); //} else { // this.simpleLabelItem1 = null; //} // layoutControlItem1 this.lciOtherChoice = new LayoutControlItem(); //add textEdit1 to layout this.memoEdit1 = new MemoEdit(); this.memoEdit1.Tag = new ScheduleData() { ParentPositionIndex = "IndexPosition" + x.ToString(), PositionIndex = "IndexPosition" + idx.ToString(), ControlContainer = lciOtherChoice, Required = oChoice.Required, HasValue = !string.IsNullOrWhiteSpace(oChoice.DefaultInputValue) ? true : false, ChoiceOption = oChoice }; this.memoEdit1.Name = "textEdit" + Guid.NewGuid().ToString(); this.memoEdit1.Properties.ScrollBars = System.Windows.Forms.ScrollBars.None; this.memoEdit1.StyleController = this.StyleController; if (oChoice.DefaultInputValue != null) { this.memoEdit1.Text = oChoice.DefaultInputValue.Trim(); oChoice.InputValue = oChoice.DefaultInputValue.Trim(); } memoEdit1.TextChanged += new EventHandler(memoEdit1_TextChanged); memoEdit1.Resize += new EventHandler(memoEdit1_Resize); memoEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.lciOtherChoice.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.lciOtherChoice.Control = this.memoEdit1; if (!string.IsNullOrEmpty(oChoice.TextPrefix)) { this.lciOtherChoice.Text = oChoice.TextPrefix; this.lciOtherChoice.TextVisible = true; this.lciOtherChoice.TextLocation = DevExpress.Utils.Locations.Top; this.lciOtherChoice.MaxSize = new Size(0, 41); this.lciOtherChoice.MinSize = new Size(0, 41); } else { this.lciOtherChoice.TextVisible = false; this.lciOtherChoice.MaxSize = new Size(0, 24); this.lciOtherChoice.MinSize = new Size(0, 24); } this.lciOtherChoice.SizeConstraintsType = SizeConstraintsType.Custom; this.lciOtherChoice.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.lciOtherChoice.ShowInCustomizationForm = false; this.layoutControlGroupQuestion1.AddItem(this.lciOtherChoice); idx++; } } #endregion } #region Footer //string prioText = oSettings.Priority; //if (oSettings.CustomerOwnership && oSettings.BVOwnership) { // prioText += "(Cust+BV)"; //} else if (oSettings.CustomerOwnership) { // prioText += "(Cust)"; //} else if (oSettings.BVOwnership) { // prioText += "(BV)"; //} //if (oSettings.PlotDoneStatus.Trim().ToLower() == "done") { // prioText += " Done"; //} //// simpleLabelItem1 status //this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); //this.emptySpaceItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString(); //this.emptySpaceItem1.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); //this.emptySpaceItem1.AppearanceItemCaption.Options.UseTextOptions = true; //this.emptySpaceItem1.ShowInCustomizationForm = false; //this.emptySpaceItem1.SizeConstraintsType = SizeConstraintsType.Custom; //this.emptySpaceItem1.Text = prioText; //this.emptySpaceItem1.TextVisible = true; //this.emptySpaceItem1.ShowInCustomizationForm = false; //this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); //this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1); //if (!string.IsNullOrEmpty(oSettings.QuestionHelp)) { // this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem(); // this.emptySpaceItem2.Name = "simpleLabelItem" + Guid.NewGuid().ToString(); // this.emptySpaceItem2.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); // this.emptySpaceItem2.AppearanceItemCaption.Options.UseTextOptions = true; // this.emptySpaceItem2.ShowInCustomizationForm = false; // this.emptySpaceItem2.Text = "Help"; // this.emptySpaceItem2.OptionsToolTip.ToolTip = oSettings.QuestionHelp.Trim(); // //apply tooltip controller from parent // //if (this.ToolTipController != null && this.ToolTipController.DefaultController != null) { // // this.emptySpaceItem2.OptionsToolTip.ToolTipController = ToolTipController.DefaultController; // //} // this.emptySpaceItem2.TextVisible = true; // this.emptySpaceItem2.Size = new Size(50, 20); // this.emptySpaceItem2.MaxSize = new Size(50, 20); // this.emptySpaceItem2.MinSize = new Size(50, 20); // this.emptySpaceItem2.SizeConstraintsType = SizeConstraintsType.Custom; // this.emptySpaceItem2.ShowInCustomizationForm = false; // this.emptySpaceItem2.Click += new EventHandler(layoutControlGroupQuestion1_Click); // this.emptySpaceItem2.AppearanceItemCaption.TextOptions.HAlignment = HorzAlignment.Far; // this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem2, this.emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Right); //} #endregion this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.EndUpdate(); Image bg = BGImage(this); if (bg != null) { this.layoutControlGroupQuestion1.BackgroundImage = bg; this.layoutControlGroupQuestion1.BackgroundImageVisible = true; } if (this.memoEdit1 != null) BackColor = this.memoEdit1.BackColor; //lookUpEdit2.EditValue = null; //lookUpEdit2.ItemIndex = 0; this.ControlGroup = this.layoutControlGroupQuestion1; this.ControlGroup.Tag = this; isLoaded = true; }
public void BindControls() { if (Questionnaire == null) MessageBox.Show("Questionnaire must be bind with JSON first.", "Textbox Component"); m_DynamicControls = new List<DynamicControl>(); #region Layout Control Group Initialize isLoaded = false; this.layoutControlGroupQuestion1.Clear(); Settings oSettings = Questionnaire.Form.Settings; // layoutControlGroupQuestion1 this.layoutControlGroupQuestion1.Name = "layoutControlGroupQuestion" + Guid.NewGuid().ToString(); this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true; this.layoutControlGroupQuestion1.ExpandButtonVisible = false; this.layoutControlGroupQuestion1.GroupBordersVisible = true; this.layoutControlGroupQuestion1.TextVisible = false; this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1, 1, 1); this.layoutControlGroupQuestion1.ShowInCustomizationForm = false; //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText; this.layoutControlGroupQuestion1.BeginUpdate(); #endregion #region Footer this.layoutControlItem1 = new LayoutControlItem(); this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString(); //bool isCustomerOwnershipOnly = false; //if (oSettings.CustomerOwnership && oSettings.BVOwnership) // isCustomerOwnershipOnly = true; //ctlFooter = new Footer() { // IsAccountLevel = oSettings.DataBindings.account_level, // IsCustomerOwnershipOnly = isCustomerOwnershipOnly, // HelpText = oSettings.QuestionHelp, // LanguageCode = oSettings.DataBindings.language_code //}; ctlFooter = new Footer() { IsAccountLevel = oSettings.DataBindings.account_level, IsCustomerOwned = oSettings.CustomerOwnership, IsBrightvisionOwned = oSettings.BVOwnership, HelpText = oSettings.QuestionHelp, LanguageCode = oSettings.DataBindings.language_code, QuestionText = oSettings.Label + " " + oSettings.QuestionText }; ctlFooter.InitializeFooter(); ctlFooter.Dock = DockStyle.Fill; ctlFooter.Height = 20; this.layoutControlItem1.Control = ctlFooter; this.layoutControlItem1.ShowInCustomizationForm = false; this.layoutControlItem1.TextVisible = false; this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlItem1.MinSize = new Size(0, 24); this.layoutControlItem1.MaxSize = new Size(0, 24); this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1); #endregion #region Answer Option Binding IList<AnswerOption> answeroptionList = Questionnaire.Form.Settings.AnswerOptions; ITextbox answeroption = null; int iAnswerOptions = answeroptionList.Count; //System.Drawing.Size newSize; for (int x = 0; x < iAnswerOptions; ++x) { answeroption = answeroptionList[x] as ITextbox; // layoutControlItem1 this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); //add textEdit1 to layout this.memoEdit1 = new MemoEdit(); this.memoEdit1.Tag = new TextboxData() { PositionIndex = "IndexPosition" + x, ControlContainer = layoutControlItem1, Required = answeroption.Required, HasValue = !string.IsNullOrWhiteSpace(answeroption.DefaultInputValue) ? true : false, AnswerOption = answeroption }; this.memoEdit1.Name = "textEdit" + Guid.NewGuid().ToString(); this.memoEdit1.Properties.ScrollBars = ScrollBars.None; this.memoEdit1.StyleController = this.StyleController; //set value string _DefaultValue = string.Empty; if (answeroption.DefaultInputValue != null) { _DefaultValue = answeroption.DefaultInputValue.Trim(); this.memoEdit1.Text = answeroption.DefaultInputValue.Trim(); answeroption.InputValue = answeroption.DefaultInputValue.Trim(); } m_DynamicControls.Add(new DynamicControl() { DefaultValue = _DefaultValue }); memoEdit1.TextChanged += new EventHandler(textEdit1_TextChanged); memoEdit1.Resize += new EventHandler(memoEdit1_Resize); memoEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString(); this.layoutControlItem1.Control = this.memoEdit1; //int width = 1000, height = 1000; //if (!string.IsNullOrEmpty(answeroption.TextboxMaxWidth)) { // int.TryParse(answeroption.TextboxMaxWidth, out width); //} //if (!string.IsNullOrEmpty(answeroption.TextboxMaxHeight)) { // int.TryParse(answeroption.TextboxMaxHeight, out height); //} if (!string.IsNullOrEmpty(answeroption.TextPrefix)) { this.layoutControlItem1.Text = answeroption.TextPrefix; this.layoutControlItem1.TextVisible = true; this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top; this.layoutControlItem1.MinSize = new Size(0, 41); this.layoutControlItem1.MaxSize = new Size(0, 41); } else { this.layoutControlItem1.TextVisible = false; this.layoutControlItem1.MinSize = new Size(0, 24); this.layoutControlItem1.MaxSize = new Size(0, 24); } //newSize = new System.Drawing.Size(width, height); this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1); } //string prioText = oSettings.Priority; //if (oSettings.CustomerOwnership && oSettings.BVOwnership) { // prioText += "(Cust+BV)"; //} else if (oSettings.CustomerOwnership) { // prioText += "(Cust)"; //} else if (oSettings.BVOwnership) { // prioText += "(BV)"; //} //if (oSettings.PlotDoneStatus.Trim().ToLower() == "done") { // prioText += " Done"; //} //// simpleLabelItem1 status //this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); //this.emptySpaceItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString(); //this.emptySpaceItem1.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); //this.emptySpaceItem1.AppearanceItemCaption.Options.UseTextOptions = true; //this.emptySpaceItem1.ShowInCustomizationForm = false; //this.emptySpaceItem1.Text = prioText; //this.emptySpaceItem1.TextVisible = true; //this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click); //this.emptySpaceItem1.SizeConstraintsType = SizeConstraintsType.Custom; //this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1); //if (!string.IsNullOrEmpty(oSettings.QuestionHelp)) { // this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem(); // this.emptySpaceItem2.Name = "simpleLabelItem" + Guid.NewGuid().ToString(); // this.emptySpaceItem2.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); // this.emptySpaceItem2.AppearanceItemCaption.Options.UseTextOptions = true; // this.emptySpaceItem2.ShowInCustomizationForm = false; // this.emptySpaceItem2.Text = "Help"; // this.emptySpaceItem2.OptionsToolTip.ToolTip = oSettings.QuestionHelp.Trim(); // //apply tooltip controller from parent // //if (this.ToolTipController != null && this.ToolTipController.DefaultController != null) { // // this.emptySpaceItem2.OptionsToolTip.ToolTipController = ToolTipController.DefaultController; // //} // this.emptySpaceItem2.TextVisible = true; // this.emptySpaceItem2.Size = new Size(50, 20); // this.emptySpaceItem2.MaxSize = new Size(50, 20); // this.emptySpaceItem2.MinSize = new Size(50, 20); // this.emptySpaceItem2.SizeConstraintsType = SizeConstraintsType.Custom; // this.emptySpaceItem2.Click += new EventHandler(layoutControlGroupQuestion1_Click); // this.emptySpaceItem2.AppearanceItemCaption.TextOptions.HAlignment = HorzAlignment.Far; // this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem2, this.emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Right); //} #endregion this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.EndUpdate(); Image bg = BGImage(this); if (bg != null) { this.layoutControlGroupQuestion1.BackgroundImage = bg; this.layoutControlGroupQuestion1.BackgroundImageVisible = true; } if (this.memoEdit1 != null) BackColor = this.memoEdit1.BackColor; this.ControlGroup = this.layoutControlGroupQuestion1; this.ControlGroup.Tag = this; isLoaded = true; }
private void InitializeComponent() { DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject(); this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); this.simpleButtonCancel = new DevExpress.XtraEditors.SimpleButton(); this.simpleButtonSave = new DevExpress.XtraEditors.SimpleButton(); this.gridControlHistory = new DevExpress.XtraGrid.GridControl(); this.gridViewHistory = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gridColumnId = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumnComment = new DevExpress.XtraGrid.Columns.GridColumn(); this.repositoryItemMemoEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit(); this.repositoryItemMemoEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit(); this.gridColumnCreationDate = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumnUser = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumnCustomerContact = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumnDelete = new DevExpress.XtraGrid.Columns.GridColumn(); this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); this.repositoryItemButtonEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); this.memoEdit1 = new DevExpress.XtraEditors.MemoEdit(); this.layoutControlGroupQuestion1 = new DevExpress.XtraLayout.LayoutControlGroup(); this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItemHeader = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItemHeader.Name = "layoutControlItemHeader"+Guid.NewGuid().ToString(); this.layoutControlItemPrefix = new DevExpress.XtraLayout.LayoutControlItem(); this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); // // layoutControlGroupQuestion1 // this.layoutControlGroupQuestion1.CustomizationFormText = "Root"; this.layoutControlGroupQuestion1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true; this.layoutControlGroupQuestion1.ExpandButtonVisible = false; this.layoutControlGroupQuestion1.GroupBordersVisible = true; this.layoutControlGroupQuestion1.TextVisible = false; //this.layoutControlGroupQuestion1.Location = new System.Drawing.Point(0, 0); this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1, 1, 1); this.layoutControlGroupQuestion1.ShowInCustomizationForm = false; //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText; this.layoutControlGroupQuestion1.BeginUpdate(); #region Prefix lprefix = new Label(); lprefix.Name = "lprefix"; lprefix.Text = ""; lprefix.Visible = false; this.layoutControlItemPrefix.Location = new System.Drawing.Point(0, 0); this.layoutControlItemPrefix.Name = "layoutControlItemPrefix1"; this.layoutControlItemPrefix.Control = lprefix; this.layoutControlItemPrefix.ShowInCustomizationForm = false; this.layoutControlItemPrefix.TextVisible = false; this.layoutControlItemPrefix.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlItemPrefix.MinSize = new Size(0, 10); this.layoutControlItemPrefix.MaxSize = new Size(0, 10); this.layoutControlItemPrefix.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlItemPrefix.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; #endregion #region Footer //bool isCustomerOwned = false; //bool isBrightvisionOwned = false; //if (oSettings.CustomerOwnership && oSettings.BVOwnership) // isCustomerOwnershipOnly = true; //ctlFooter = new Footer() { // IsAccountLevel = oSettings.DataBindings.account_level, // IsCustomerOwnershipOnly = isCustomerOwnershipOnly, // HelpText = oSettings.QuestionHelp, // LanguageCode = oSettings.DataBindings.language_code //}; Settings oSettings = Questionnaire.Form.Settings; ctlFooter = new Footer() { IsAccountLevel = oSettings.DataBindings.account_level, IsCustomerOwned = oSettings.CustomerOwnership, IsBrightvisionOwned = oSettings.BVOwnership, HelpText = oSettings.QuestionHelp, LanguageCode = oSettings.DataBindings.language_code, QuestionText = oSettings.Label + " " + oSettings.QuestionText }; ctlFooter.InitializeFooter(); ctlFooter.Dock = DockStyle.Fill; ctlFooter.Height = 20; this.layoutControlItemHeader.Control = ctlFooter; this.layoutControlItemHeader.ShowInCustomizationForm = false; this.layoutControlItemHeader.TextVisible = false; this.layoutControlItemHeader.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlItemHeader.MinSize = new Size(0, 24); this.layoutControlItemHeader.MaxSize = new Size(0, 24); this.layoutControlItemHeader.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlItemHeader.SizeConstraintsType = SizeConstraintsType.Default; #endregion // // layoutControl1 // this.layoutControl1.Controls.Add(this.ctlFooter); this.layoutControl1.Controls.Add(this.simpleButtonCancel); this.layoutControl1.Controls.Add(this.simpleButtonSave); this.layoutControl1.Controls.Add(this.gridControlHistory); this.layoutControl1.Controls.Add(this.memoEdit1); this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.layoutControl1.Location = new System.Drawing.Point(0, 0); this.layoutControl1.Name = "layoutControl1"; this.layoutControl1.Root = this.layoutControlGroupQuestion1; //this.layoutControl1.Size = new System.Drawing.Size(539, 216); this.layoutControl1.TabIndex = 2; this.layoutControl1.Text = "layoutControl1"; // // simpleButtonCancel // this.simpleButtonCancel.Image = global::BrightVision.DQControl.Properties.Resources.cancel_16x16; this.simpleButtonCancel.Location = new System.Drawing.Point(498, 41); this.simpleButtonCancel.Margin = new System.Windows.Forms.Padding(1); this.simpleButtonCancel.Name = "simpleButtonCancel"; this.simpleButtonCancel.MinimumSize = new System.Drawing.Size(22, 22); this.simpleButtonCancel.MaximumSize = new System.Drawing.Size(22, 22); this.simpleButtonCancel.ImageLocation = ImageLocation.MiddleCenter; this.simpleButtonCancel.StyleController = this.layoutControl1; this.simpleButtonCancel.TabIndex = 7; this.simpleButtonCancel.ToolTip = "Cancel"; this.simpleButtonCancel.Click += new EventHandler(simpleButtonCancel_Click); // // simpleButtonSave // this.simpleButtonSave.Image = global::BrightVision.DQControl.Properties.Resources.save_16x16; this.simpleButtonSave.Location = new System.Drawing.Point(498, 7); this.simpleButtonSave.Margin = new System.Windows.Forms.Padding(1); this.simpleButtonSave.Name = "simpleButtonSave"; this.simpleButtonSave.MinimumSize = new System.Drawing.Size(22, 22); this.simpleButtonSave.MaximumSize = new System.Drawing.Size(22, 22); this.simpleButtonSave.ImageLocation = ImageLocation.MiddleCenter; this.simpleButtonSave.StyleController = this.layoutControl1; this.simpleButtonSave.TabIndex = 6; this.simpleButtonSave.Click += new EventHandler(simpleButtonSave_Click); this.simpleButtonSave.ToolTip = "Save"; // // gridControl1 // this.gridControlHistory.Location = new System.Drawing.Point(7, 75); this.gridControlHistory.MainView = this.gridViewHistory; this.gridControlHistory.Name = "gridControlHistory"; this.gridControlHistory.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { this.repositoryItemButtonEdit1, this.repositoryItemMemoEdit1, this.repositoryItemMemoEdit2, this.repositoryItemButtonEdit2}); this.gridControlHistory.MinimumSize = new System.Drawing.Size(0, 150); this.gridControlHistory.MaximumSize = new System.Drawing.Size(0, 150); this.gridControlHistory.Size = new Size(0, 150); this.gridControlHistory.TabIndex = 4; this.gridControlHistory.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridViewHistory}); // // gridView1 // this.gridViewHistory.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { this.gridColumnId, this.gridColumnComment, this.gridColumnCreationDate, this.gridColumnUser, this.gridColumnCustomerContact, this.gridColumnDelete}); this.gridViewHistory.GridControl = this.gridControlHistory; this.gridViewHistory.Name = "gridViewHistory"; this.gridViewHistory.OptionsSelection.EnableAppearanceFocusedCell = false; this.gridViewHistory.OptionsView.RowAutoHeight = true; this.gridViewHistory.OptionsView.ShowGroupPanel = false; this.gridViewHistory.OptionsBehavior.ReadOnly = true; //this.gridViewHistory.VertScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always; this.gridViewHistory.CustomRowCellEdit += new DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventHandler(gridViewHistory_CustomRowCellEdit); // //gridcolumn id // this.gridColumnId.Caption = "Id"; this.gridColumnId.FieldName = "id"; this.gridColumnId.Name = "gridColumnId"; this.gridColumnId.Visible = false; // // gridColumn1 // this.gridColumnComment.Caption = "Comment"; this.gridColumnComment.ColumnEdit = this.repositoryItemMemoEdit1; this.gridColumnComment.FieldName = "Comment"; this.gridColumnComment.Name = "gridColumnComment"; this.gridColumnComment.Visible = true; this.gridColumnComment.VisibleIndex = 0; this.gridColumnComment.Width = 200; this.gridColumnComment.MaxWidth = 0; this.gridColumnComment.MinWidth = 0; this.gridColumnComment.ColumnEdit.EditValueChanged += new EventHandler(ColumnEdit_EditValueChanged); // // repositoryItemMemoEdit1 // this.repositoryItemMemoEdit1.Name = "repositoryItemMemoEdit1"; this.repositoryItemMemoEdit1.ReadOnly = false; this.repositoryItemMemoEdit2.Name = "repositoryItemMemoEdit2"; this.repositoryItemMemoEdit2.ReadOnly = true; // // gridColumn2 // this.gridColumnCreationDate.Caption = "Date"; this.gridColumnCreationDate.FieldName = "CreationDate"; this.gridColumnCreationDate.Name = "gridColumnCreationDate"; this.gridColumnCreationDate.Visible = true; this.gridColumnCreationDate.VisibleIndex = 1; this.gridColumnCreationDate.Width = 50; this.gridColumnCreationDate.MaxWidth = 0; this.gridColumnCreationDate.MinWidth = 0; this.gridColumnCreationDate.DisplayFormat.FormatType = FormatType.Custom; this.gridColumnCreationDate.DisplayFormat.Format = new DateCustomFormatter(); this.gridColumnCreationDate.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm"; this.gridColumnCreationDate.OptionsColumn.ReadOnly = true; // // gridColumn3 // this.gridColumnUser.Caption = "User"; this.gridColumnUser.FieldName = "User"; this.gridColumnUser.Name = "gridColumnUser"; this.gridColumnUser.Visible = true; this.gridColumnUser.VisibleIndex = 2; this.gridColumnUser.Width = 70; this.gridColumnUser.MaxWidth = 0; this.gridColumnUser.MinWidth = 0; this.gridColumnUser.OptionsColumn.ReadOnly = true; // // gridColumn4 // this.gridColumnCustomerContact.Caption = "Contact"; this.gridColumnCustomerContact.FieldName = "CustomerContact"; this.gridColumnCustomerContact.Name = "gridColumnCustomerContact"; this.gridColumnCustomerContact.Visible = true; this.gridColumnCustomerContact.VisibleIndex = 3; this.gridColumnCustomerContact.Width = 70; this.gridColumnCustomerContact.MaxWidth = 0; this.gridColumnCustomerContact.MinWidth = 0; this.gridColumnCustomerContact.OptionsColumn.ReadOnly = true; // // gridColumn5 // this.gridColumnDelete.Caption = ""; this.gridColumnDelete.ColumnEdit = this.repositoryItemButtonEdit1; this.gridColumnDelete.FieldName = ""; this.gridColumnDelete.MaxWidth = 30; this.gridColumnDelete.Name = "gridColumnDelete"; this.gridColumnDelete.Visible = true; this.gridColumnDelete.VisibleIndex = 4; this.gridColumnDelete.Width = 30; this.gridColumnDelete.OptionsColumn.ReadOnly = true; // // repositoryItemButtonEdit1 // Image img = ((System.Drawing.Image)(global::BrightVision.DQControl.Properties.Resources.cancel_16x16)); var btn = new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", -1, true, true, false, DevExpress.XtraEditors.ImageLocation.MiddleCenter, img, null, null, "Delete"); this.repositoryItemButtonEdit1.Buttons.Add(btn); this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1"; this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; //this.repositoryItemButtonEdit1.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(repositoryItemButtonDelete_ButtonClick); this.repositoryItemButtonEdit1.Click += new EventHandler(repositoryItemButtonDelete_Click); //btn.Appearance.Image = img; this.repositoryItemButtonEdit2.Buttons.Add(btn); this.repositoryItemButtonEdit2.Name = "repositoryItemButtonEdit1"; this.repositoryItemButtonEdit2.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; this.repositoryItemButtonEdit2.ReadOnly = true; // // memoEdit1 // this.memoEdit1.Location = new System.Drawing.Point(7, 7); this.memoEdit1.Name = "memoEdit1"; //this.memoEdit1.MinimumSize = new Size(100, 52); //this.memoEdit1.MaximumSize = new Size(0,0); this.memoEdit1.StyleController = this.layoutControl1; this.memoEdit1.TabIndex = 8; this.memoEdit1.Properties.ScrollBars = ScrollBars.None; this.memoEdit1.TextChanged += new EventHandler(memoEdit1_TextChanged); // // emptySpaceItem1 // this.emptySpaceItem1.AllowHotTrack = false; this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1"; this.emptySpaceItem1.Location = new System.Drawing.Point(383, 52); this.emptySpaceItem1.Name = "emptySpaceItem1"; this.emptySpaceItem1.Size = new System.Drawing.Size(22, 212); this.emptySpaceItem1.Text = "emptySpaceItem1"; this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); // //gridControl // this.layoutControlItem1.Control = this.gridControlHistory; this.layoutControlItem1.CustomizationFormText = "layoutControlItem1"; this.layoutControlItem1.Location = new System.Drawing.Point(0, 68); //this.layoutControlItem1.MinSize = new System.Drawing.Size(0, 100); //this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 200); this.Size = new Size(0, 150); this.layoutControlItem1.Name = "layoutControlItem1"; this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.SupportHorzAlignment; this.layoutControlItem1.ControlAlignment = ContentAlignment.BottomCenter; //this.layoutControlItem1.Size = new Size(0, 150); this.layoutControlItem1.Text = "layoutControlItem1"; this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem1.TextToControlDistance = 0; this.layoutControlItem1.TextVisible = false; // // layoutControlItem3 // this.layoutControlItem3.Control = this.simpleButtonSave; this.layoutControlItem3.CustomizationFormText = "layoutControlItem3"; this.layoutControlItem3.Location = new System.Drawing.Point(491, 0); this.layoutControlItem3.MaxSize = new System.Drawing.Size(22, 22); this.layoutControlItem3.MinSize = new System.Drawing.Size(22, 22); this.layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(1); this.layoutControlItem3.Name = "layoutControlItem3"; this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Default; this.layoutControlItem3.Text = "layoutControlItem3"; this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem3.TextToControlDistance = 0; this.layoutControlItem3.TextVisible = false; // // layoutControlItem4 // this.layoutControlItem4.Control = this.simpleButtonCancel; this.layoutControlItem4.CustomizationFormText = "layoutControlItem4"; this.layoutControlItem4.Location = new System.Drawing.Point(491, 34); this.layoutControlItem4.MaxSize = new System.Drawing.Size(22, 102); this.layoutControlItem4.MinSize = new System.Drawing.Size(22, 22); this.layoutControlItem4.Size = new Size(22, 102); this.layoutControlItem4.Padding = new DevExpress.XtraLayout.Utils.Padding(1); this.layoutControlItem4.Name = "layoutControlItem4"; this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Default; this.layoutControlItem4.Text = "layoutControlItem4"; this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem4.TextToControlDistance = 0; this.layoutControlItem4.TextVisible = false; // // layoutControlItem2 // this.layoutControlItem2.Control = this.memoEdit1; this.layoutControlItem2.CustomizationFormText = "layoutControlItem2"; this.layoutControlItem2.Location = new System.Drawing.Point(0, 0); this.layoutControlItem2.Name = "layoutControlItem2"; this.layoutControlItem2.Text = "layoutControlItem2"; this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem1.MinSize = new Size(0, 24); this.layoutControlItem1.MaxSize = new Size(0, 24); this.layoutControlItem2.TextToControlDistance = 0; this.layoutControlItem2.TextVisible = false; this.layoutControlItem2.SizeConstraintsType = SizeConstraintsType.SupportHorzAlignment; // // testinglayout // this.layoutControlGroupQuestion1.AddItem(this.layoutControlItemHeader); this.layoutControlGroupQuestion1.AddItem(this.layoutControlItemPrefix); this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem2); this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem3, this.layoutControlItem2, DevExpress.XtraLayout.Utils.InsertType.Right); this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem4, this.layoutControlItem3, DevExpress.XtraLayout.Utils.InsertType.Bottom); this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1); this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.EndUpdate(); }
private void SmartText_Disposed(object sender, EventArgs e) { this.layoutControlItemHeader.Click -= new EventHandler(layoutControlGroupQuestion1_Click); this.layoutControlGroupQuestion1.Click -= new EventHandler(layoutControlGroupQuestion1_Click); this.OnComponentNotifyChanged = null; ctlFooter.Parent = null; ctlFooter = null; this.ControlGroup.Tag = null; this.ControlGroup = null; this.Parent = null; }