473,546 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataBinding ... (long)

public class Xxx
{
private string tableName = ""

public string TableName
{
get{return this.tableName; }
set
{
if(value != null)
{
this.tableName = value.Trim()
}
else
{
this.tableName = ""
}
}
}
}

Xxx xxx = new Xxx();

The scanario is:
I have a MdiContainer Form1 and I'm displaying MdiChilds in it.
On every child form I'm binding a TextBox Text property to a
property TableName of xxx passed to a child forms constructor
as an reference.

private Xxx xxx;

// Constructor
public FormChild(ref pXxx)
{
this.xxx = pXxx;
}

protected override OnLoad(...)
{
this.TaxtBox0.D ataBindings.Add ("Text",this.xx x,"TableName" );
}

Every time (beside the first time) the ChildForm is showing I have a probem
to move between its (ChildForm) controls after changing Text of TextBox0.
In other words if i change Text of my TextBox0 i have to click 2 or 3 times
on a save button (or any other control on the form) to get this button
clicked
or any control action perform.

Without DataBinding it works ok. It works ok also if Child form is not
called
from MdiParent as MdiChild but simply run as a modal form.

So what's wrong?

The code displaying ChildForm on MdiParentForm is:

ChildForm child = new ChildForm(ref xxx);
child.MdiParent = this.
this.contentPan el.Controls.Add (child)
child.Dock = DockStyle.Fill;
child.Show();

CleanupCode is:

child.Close();
child.Dispose() ;
child = null;

I think that DataBinding has some problem in general... Every time I use
it i'm geting some problems and instabilities. I saw in other programists
examles on gotdotnet and other that tey are not using DataBinding and
useng LoadData() and SaveData() methods to simply get and set propertys
of objects like:

LoadData()
{
this.TextBox0.t ext = this.xxx.TableN ame;
}

SaveData()
{
this.xxx.TableN ame = this.TextBox0.T ext;
}

But I've got some controls in my propertys implementation and if value
is corrected I would like to user saw it before saving which scenario
above doesn't meet.

Nov 16 '05 #1
0 904

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
272
by: Jacek Jurkowski | last post by:
public class Xxx { private string tableName = "" public string TableName { get{return this.tableName;} set { if(value != null)
1
1127
by: Jacek Jurkowski | last post by:
public class Xxx { private string tableName = "" public string TableName { get{return this.tableName;} set { if(value != null)
4
4197
by: dtblankenship | last post by:
Hello everyone, I know this question has been asked many times in the forums, and after spending a few days reading, I am still confused as to the answer. I have a ListBox (lstBox), SqlConnection (sqlConnection), SqlDataAdapter (daLookupData), SqlDataAdapter (daData), DataSet (dsLookupData), and DataSet (dsData), all created via the IDE...
4
1639
by: Nathan Sokalski | last post by:
I have two databinding expressions (the first & last names from a DB) that I want to assign to the text property of a Label so that the result is LASTNAME,FIRSTNAME. At the moment, I have the following which I know works when I use it by itself: text='<%# DataBinder.Eval(Container,"DataItem.membernames.lname") %>' What I need to do is...
1
2136
by: thzero | last post by:
Is there any way to do this without using the ObjectDataSource? (Apologies for the long post) I have a simple data object: public class TestDO { public TestDO() {} public ID { get; set; } public Name { get; set; } public Description { get; set; }
5
3174
by: Peter M. | last post by:
I'm struggling with combobox databinding with something I consider a bug... I'm binding my combobox to an array of structs. The struct exposes two public properties, ID and Name, to be used as the value and displaymember properties. This works fine. My combobox contains the correct data. However I'm also binding my SelectedValue...
1
6877
by: Johnny Jörgensen | last post by:
I've got a combobox where the SelectedValue property is bound to a class property by a code like this: MyComboBox.DataBindings.Add("SelectedValue", MyClass , "MyID"); My problem is that the MyClass.MyID property gets updated when the focus leaves the combobox - not when you actually select a new item from the drdop down list. I would...
3
1876
by: Peter | last post by:
Hi! I am having some very strange behavior with my databound controls. It's taken a long time to isolate exactly what is provoking the problem, but I'm still leagues away from solving it. I have a DataView which filters a DataSet. Bound to this dataview is a ListBox, via its DataSource property. The DisplayMember is the name property of...
3
3243
by: David Smith | last post by:
I have an app that shows the time it takes to execute a search, much like SQL Management Studio, but the app behaves as though the System.Windows.Forms.Timer gets blocked while binding the results to the grid. As you might expect, I execute the search in the background but I have to return to the UI thread to bind the results. While databinding,...
0
7504
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7435
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7792
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.