473,473 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DataBinding

If I execute the following line

DataGrid1.Dispose();

it will commit all user changes being made via databinding. I'd like to
know how I can commit all user changes to all controls within a form without
having to Dispose of the controls.

I have a component that tracks which of my business objects are modified
during the lifetime of its parent form, but unfortunately if the user closes
the form without leaving the focussed control (cell in a datagrid) the
change is not applied until the Dispose method is executed, and by then my
component has been disabled.

So I basically need to commit all changes made within the form's controls
from within the Closing event. I need to perform this function from within
my component's code so will therefore have no knowledge of the specific
controls on the form or their types.

Thanks

Pete
Jul 21 '06 #1
3 1310
Hi,

Well a quick way of doing this is intercepting the closing event of the
form, and then either disposing the control or move out the focus.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Peter Morris [Droopy eyes software]" <pe**@droopyeyes.no.com.spamwrote in
message news:en**************@TK2MSFTNGP05.phx.gbl...
If I execute the following line

DataGrid1.Dispose();

it will commit all user changes being made via databinding. I'd like to
know how I can commit all user changes to all controls within a form
without having to Dispose of the controls.

I have a component that tracks which of my business objects are modified
during the lifetime of its parent form, but unfortunately if the user
closes the form without leaving the focussed control (cell in a datagrid)
the change is not applied until the Dispose method is executed, and by
then my component has been disabled.

So I basically need to commit all changes made within the form's controls
from within the Closing event. I need to perform this function from
within my component's code so will therefore have no knowledge of the
specific controls on the form or their types.

Thanks

Pete

Jul 21 '06 #2
Well a quick way of doing this is intercepting the closing event

Doing that.

and then either disposing the control
I can't do that as I don't "own" the form (I am just a component developer,
the form will belong to the user). I don't know if the user is just closing
the form and will reshow the same instance or if they intend to dispose of
it.

or move out the focus.
I don't want to do this either because I don't know
A) Which control to give focus to
B) If changing focus on the form will have some kind of adverse side effect
(event code for gaining/losing focus).

So I need to the the "proper" way :-)
Pete
Jul 21 '06 #3
Guys, I would *really* appreciate some help with this one. I have looked
into it but as yet still been unable to find the solution to it.

Thanks

Pete
If I execute the following line

DataGrid1.Dispose();

it will commit all user changes being made via databinding. I'd like to
know how I can commit all user changes to all controls within a form
without having to Dispose of the controls.

I have a component that tracks which of my business objects are modified
during the lifetime of its parent form, but unfortunately if the user
closes the form without leaving the focussed control (cell in a datagrid)
the change is not applied until the Dispose method is executed, and by
then my component has been disabled.

So I basically need to commit all changes made within the form's controls
from within the Closing event. I need to perform this function from
within my component's code so will therefore have no knowledge of the
specific controls on the form or their types.


Jul 23 '06 #4

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

Similar topics

3
by: Kevin Swanson | last post by:
I'm writing what should be a very simple app against an Oracle database. The app has a number of user controls, any one of which is loaded into a main display page using the loadControl method,...
3
by: John Bailey | last post by:
When I first built a few web pages in ASP .Net 2.0, I thought it was great. The formview and detailview contorls would automatically layout the controls for you, the update methods were...
4
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...
9
by: Dennis | last post by:
I have tried using Databinding for my application but always seem to find it very restrictive (maybe I don't completely understand it enough). I always seem to find it much easier to display a...
8
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
0
by: Wayne Sepega | last post by:
I have the following Object DataSource <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetCustomer" TypeName="Customers" DataObjectTypeName="Customer"...
9
by: J055 | last post by:
Hi I have a very simple configuration of the GridView with paging and sorting. When I do a postback the DataBinding event fires twice - in both the ProcessPostData and PreRender stages of the...
1
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. ...
8
by: Dirk | last post by:
Hello, I have a problem to use databinding with my business layer classes. My data class does not have simple properties (string, int or datetime), instead, all my properties are objects of the...
1
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello to all, I want to know if DataBinding in asp.net 2,0 is better than to fill up the values of the controls of the following form: this.miControlTextBox.Text = valorParaControlTextbox; ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
1
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
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.