Hi,
On my form inside of UltraExpandableGroupBox I have Windows.Forms.TextBox control that is bound to BindingSource.
If form is shown with UltraExpandableGroupBox collapsed - Text property of TextBox is empty.
You are right, Matt. Could not even imagine they would do such a thing.
I had tested this differently originally, where my control was visible initially. This seems to be an issue with the .NET binding mechanism where the DataBindings aren't accessed if the control isn't visible. I tried this without using any Infragistics components, simply with a TextBox and a button, and no value was returned from the bound property on the control. Since the TextBox in your sample is within an UltraExpandableGroupBox, when it is collapsed the child panel is hidden and so the control will not pick up the data-bound value.
-Matt
Hi Matt, here is a sample code:
using System;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices ;
namespace WindowsApplication1{ public partial class Form1 : Form { private Pesron person = new Pesron();
public Form1() { InitializeComponent(); this.ultraExpandableGroupBox1.Expanded = false;
person = new Pesron(); person.Id = 1; person.LastName = "first";
this.bindingSource1.DataSource = person; this.bindingSource2.DataSource = person; }
//to display text from textboxes inside and outside of groupbox private void button1_Click(object sender, EventArgs e) { this.textBox3.Text="text1 - " + this.textBox1.Text+ " text2 - " + this.textBox2.Text; }
[Serializable] public partial class Pesron { private int? id; string lastName;
public Pesron() { } public string LastName { set { this.lastName = value; } get { return this.lastName; } } public int? Id { set { this.id = value; } get { return this.id; } } }
}}
Binding from Deisigner code:
// // textBox1 // this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bindingSource1, "LastName", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); // // bindingSource1 // this.bindingSource1.DataSource = typeof(WindowsApplication1.Form1.Pesron); //
Thank you for your help.
Dmitry
I bound a .NET TextBox to a datasource, and the Text property was still working properly for me. Are you doing anythign else that might effect the bindings? Can you reproduce this in a simple sample?