Hello,
I'm using typed dataset for databinding to windows controls and I'm having
some problems.
I'm trying to move all business logic to datatable column_changing events
and the problem that I'm having is when I change some other column, control
value doesn't update immediately until I call endcurrentedit on
bindingmanager which doesnt happen until user click update button.
Here's my problem:
Private Sub BusinessPartner DataTable_Colum nChanging(ByVal sender As
System.Object, ByVal e As System.Data.Dat aColumnChangeEv entArgs) Handles
Me.ColumnChangi ng
Select Case e.Column.Column Name
Case Me.dbaColumn.Co lumnName
Me(0).categoryI D = "changed_column "
End Select
End Sub
Now, unerlying dataset.datatab le(0).categoryI D is indeed changed but
databound textbox control remains the same.
How can I force databinding.upd ate from dataset/datatable?
Thanks,
Vlado 7 2597
Which version of .Net are you using? 2003 or 2005?
Robin S.
------------------------
"Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message
news:4L******** *************** *******@giganew s.com...
Hello,
I'm using typed dataset for databinding to windows controls and I'm
having some problems.
I'm trying to move all business logic to datatable column_changing
events and the problem that I'm having is when I change some other
column, control value doesn't update immediately until I call
endcurrentedit on bindingmanager which doesnt happen until user click
update button.
Here's my problem:
Private Sub BusinessPartner DataTable_Colum nChanging(ByVal sender As
System.Object, ByVal e As System.Data.Dat aColumnChangeEv entArgs)
Handles Me.ColumnChangi ng
Select Case e.Column.Column Name
Case Me.dbaColumn.Co lumnName
Me(0).categoryI D = "changed_column "
End Select
End Sub
Now, unerlying dataset.datatab le(0).categoryI D is indeed changed but
databound textbox control remains the same.
How can I force databinding.upd ate from dataset/datatable?
Thanks,
Vlado
VB.Net 2005 and Datatable/TableAdapter.
"RobinS" <Ro****@NoSpam. yah.nonewrote in message
news:9a******** *************** *******@comcast .com...
Which version of .Net are you using? 2003 or 2005?
Robin S.
------------------------
"Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message
news:4L******** *************** *******@giganew s.com...
>Hello,
I'm using typed dataset for databinding to windows controls and I'm having some problems.
I'm trying to move all business logic to datatable column_changing events and the problem that I'm having is when I change some other column, control value doesn't update immediately until I call endcurrentedit on bindingmanag er which doesnt happen until user click update button.
Here's my problem:
Private Sub BusinessPartner DataTable_Colum nChanging(ByVal sender As System.Objec t, ByVal e As System.Data.Dat aColumnChangeEv entArgs) Handles Me.ColumnChang ing Select Case e.Column.Column Name
Case Me.dbaColumn.Co lumnName
Me(0).category ID = "changed_column "
End Select
End Sub
Now, unerlying dataset.datatab le(0).categoryI D is indeed changed but databound textbox control remains the same. How can I force databinding.upd ate from dataset/datatable? Thanks, Vlado
Did you figure out the answer to this, or are you still hanging?
Because I have a pretty good idea, if you still need an answer...
Robin S.
---------------------------
"Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message
news:rp******** *************** *******@giganew s.com...
VB.Net 2005 and Datatable/TableAdapter.
"RobinS" <Ro****@NoSpam. yah.nonewrote in message
news:9a******** *************** *******@comcast .com...
>Which version of .Net are you using? 2003 or 2005?
Robin S. ------------------------ "Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message news:4L******* *************** ********@gigane ws.com...
>>Hello,
I'm using typed dataset for databinding to windows controls and I'm having some problems.
I'm trying to move all business logic to datatable column_changing events and the problem that I'm having is when I change some other column, control value doesn't update immediately until I call endcurrentedi t on bindingmanager which doesnt happen until user click update button.
Here's my problem:
Private Sub BusinessPartner DataTable_Colum nChanging(ByVal sender As System.Object , ByVal e As System.Data.Dat aColumnChangeEv entArgs) Handles Me.ColumnChangi ng Select Case e.Column.Column Name
Case Me.dbaColumn.Co lumnName
Me(0).categor yID = "changed_column "
End Select
End Sub
Now, unerlying dataset.datatab le(0).categoryI D is indeed changed but databound textbox control remains the same. How can I force databinding.upd ate from dataset/datatable? Thanks, Vlado
Still need an answer.
I made a workaround by creating an event under datatable and form subscribes
to it and calls BindingManager. EndCurrentEdit but would like to know if
there's another way.
Thanks,
Vlado
"RobinS" <Ro****@NoSpam. yah.nonewrote in message
news:eO******** *************** *******@comcast .com...
Did you figure out the answer to this, or are you still hanging?
Because I have a pretty good idea, if you still need an answer...
Robin S.
---------------------------
"Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message
news:rp******** *************** *******@giganew s.com...
>VB.Net 2005 and Datatable/TableAdapter.
"RobinS" <Ro****@NoSpam. yah.nonewrote in message news:9a******* *************** ********@comcas t.com...
>>Which version of .Net are you using? 2003 or 2005?
Robin S. ------------------------ "Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message news:4L****** *************** *********@gigan ews.com... Hello,
I'm using typed dataset for databinding to windows controls and I'm having some problems.
I'm trying to move all business logic to datatable column_changing events and the problem that I'm having is when I change some other column, control value doesn't update immediately until I call endcurrented it on bindingmanager which doesnt happen until user click update button.
Here's my problem:
Private Sub BusinessPartner DataTable_Colum nChanging(ByVal sender As System.Objec t, ByVal e As System.Data.Dat aColumnChangeEv entArgs) Handles Me.ColumnChangi ng Select Case e.Column.Column Name
Case Me.dbaColumn.Co lumnName
Me(0).catego ryID = "changed_column "
End Select
End Sub
Now, unerlying dataset.datatab le(0).categoryI D is indeed changed but databound textbox control remains the same. How can I force databinding.upd ate from dataset/datatable? Thanks, Vlado
Why are you using the Column_Changing events? Just a masochist? In my
experience, events never work the way you think they should in .Net, or in
the order you think they should.
Anyway, if I understand what you're doing, you're changing the data source
and the change is not reflected in the data displayed in the controls on
the screen that are bound to that data source.
Have you checked out the BindingSource? It is an intermediary between your
controls and your data source, and immediately reflects any changes made to
the data source in the controls. To push it the other way, you invoke
EndEdit. Then of course, you have to call Update on your adapter to push
the changes down to the data source.
So you add a Binding Source (add the component to your form from the Data
toolbox).
Set the data source of it to your data table.
myBindingSource .DataSource = myDataTable
Then bind your controls to the BindingSource.
myTextBox.DataB indings.Add(new Binding("Text", _
myBindingSource , "CompanyNam e", true))
myGrid.DataSour ce = myBindingSource
See if that gets you anywhere. And answer my question at the top; maybe I
can recommend another solution.
I use the n-layer model, so all of the data I display on the screen is
defined in Classes. I capture changes to them when the Property value is
modified.
Robin S.
-------------------------------------------------
"Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message
news:ka******** *************** *******@giganew s.com...
Still need an answer.
I made a workaround by creating an event under datatable and form
subscribes to it and calls BindingManager. EndCurrentEdit but would like
to know if there's another way.
Thanks,
Vlado
"RobinS" <Ro****@NoSpam. yah.nonewrote in message
news:eO******** *************** *******@comcast .com...
>Did you figure out the answer to this, or are you still hanging? Because I have a pretty good idea, if you still need an answer...
Robin S. --------------------------- "Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message news:rp******* *************** ********@gigane ws.com...
>>VB.Net 2005 and Datatable/TableAdapter.
"RobinS" <Ro****@NoSpam. yah.nonewrote in message news:9a****** *************** *********@comca st.com... Which version of .Net are you using? 2003 or 2005?
Robin S. ------------------------ "Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message news:4L***** *************** **********@giga news.com... Hello, > I'm using typed dataset for databinding to windows controls and I'm having some problems. > I'm trying to move all business logic to datatable column_changing events and the problem that I'm having is when I change some other column, control value doesn't update immediately until I call endcurrente dit on bindingmanager which doesnt happen until user click update button. > Here's my problem: > Private Sub BusinessPartner DataTable_Colum nChanging(ByVal sender As System.Obje ct, ByVal e As System.Data.Dat aColumnChangeEv entArgs) Handles Me.ColumnChangi ng Select Case e.Column.Column Name > Case Me.dbaColumn.Co lumnName > Me(0).categ oryID = "changed_column " > End Select > > End Sub > > Now, unerlying dataset.datatab le(0).categoryI D is indeed changed but databound textbox control remains the same. > > > How can I force databinding.upd ate from dataset/datatable? > > > Thanks, > > > Vlado > >
Robin,
I'm using Column_Changing mostly to validate input.
In this case, Column_Changing should change different column depending on
current column's value.
I know about BindingSource and I'm using BindingManager but that's on form
level.
I didn't find a way to force databinding update from a datatable except as a
workaround with raising Event as described.
Also, I do use n-tier model but Business and Data tier is contained in one
layer (Datasets/Datatable). All the validation/ updating datasource happens
here. This is acceptable scenario for us as we don't anticipate having
database source other than MSSQL and don't have problem with BusinessObjects
and DataLayer not being loosely coupled.
Again, the only problem is how to force Databinding, EndCurrentEdit from
Datatable.
"RobinS" <Ro****@NoSpam. yah.nonewrote in message
news:Fr******** *************** *******@comcast .com...
Why are you using the Column_Changing events? Just a masochist? In my
experience, events never work the way you think they should in .Net, or in
the order you think they should.
Anyway, if I understand what you're doing, you're changing the data source
and the change is not reflected in the data displayed in the controls on
the screen that are bound to that data source.
Have you checked out the BindingSource? It is an intermediary between your
controls and your data source, and immediately reflects any changes made
to the data source in the controls. To push it the other way, you invoke
EndEdit. Then of course, you have to call Update on your adapter to push
the changes down to the data source.
So you add a Binding Source (add the component to your form from the Data
toolbox).
Set the data source of it to your data table.
myBindingSource .DataSource = myDataTable
Then bind your controls to the BindingSource.
myTextBox.DataB indings.Add(new Binding("Text", _
myBindingSource , "CompanyNam e", true))
myGrid.DataSour ce = myBindingSource
See if that gets you anywhere. And answer my question at the top; maybe I
can recommend another solution.
I use the n-layer model, so all of the data I display on the screen is
defined in Classes. I capture changes to them when the Property value is
modified.
Robin S.
-------------------------------------------------
"Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message
news:ka******** *************** *******@giganew s.com...
>Still need an answer.
I made a workaround by creating an event under datatable and form subscribes to it and calls BindingManager. EndCurrentEdit but would like to know if there's another way.
Thanks,
Vlado
"RobinS" <Ro****@NoSpam. yah.nonewrote in message news:eO******* *************** ********@comcas t.com...
>>Did you figure out the answer to this, or are you still hanging? Because I have a pretty good idea, if you still need an answer...
Robin S. --------------------------- "Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message news:rp****** *************** *********@gigan ews.com... VB.Net 2005 and Datatable/TableAdapter.
"RobinS" <Ro****@NoSpam. yah.nonewrote in message news:9a***** *************** **********@comc ast.com... Which version of .Net are you using? 2003 or 2005? > Robin S. ------------------------ "Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message news:4L**** *************** ***********@gig anews.com... >Hello, >> >I'm using typed dataset for databinding to windows controls and I'm >having some problems. >> >I'm trying to move all business logic to datatable column_changing >events and the problem that I'm having is when I change some other >column, control value doesn't update immediately until I call >endcurrent edit on bindingmanager which doesnt happen until user click >update button. >> >Here's my problem: >> >Private Sub BusinessPartner DataTable_Colum nChanging(ByVal sender As >System.Obj ect, ByVal e As System.Data.Dat aColumnChangeEv entArgs) >Handles Me.ColumnChangi ng >Select Case e.Column.Column Name >> >Case Me.dbaColumn.Co lumnName >> >Me(0).cate goryID = "changed_column " >> >End Select >> >> >End Sub >> >> >Now, unerlying dataset.datatab le(0).categoryI D is indeed changed but >databoun d textbox control remains the same. >> >> >> >How can I force databinding.upd ate from dataset/datatable? >> >> >> >Thanks, >> >> >> >Vlado >> >> > >
Did you *try* the BindingSource? Because if you use one, and update the
underlying data source, the changes will be reflected on the bound
controls.
I've never used the Binding Manager; I always use a BindingSource because
it's to nifty. Give it a try, and let me know if it works.
Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------------
"Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message
news:IZ******** *************** *******@giganew s.com...
Robin,
I'm using Column_Changing mostly to validate input.
In this case, Column_Changing should change different column depending on
current column's value.
I know about BindingSource and I'm using BindingManager but that's on
form level.
I didn't find a way to force databinding update from a datatable except
as a workaround with raising Event as described.
Also, I do use n-tier model but Business and Data tier is contained in
one layer (Datasets/Datatable). All the validation/ updating datasource
happens here. This is acceptable scenario for us as we don't anticipate
having database source other than MSSQL and don't have problem with
BusinessObjects and DataLayer not being loosely coupled.
Again, the only problem is how to force Databinding, EndCurrentEdit from
Datatable.
"RobinS" <Ro****@NoSpam. yah.nonewrote in message
news:Fr******** *************** *******@comcast .com...
>Why are you using the Column_Changing events? Just a masochist? In my experience, events never work the way you think they should in .Net, or in the order you think they should.
Anyway, if I understand what you're doing, you're changing the data source and the change is not reflected in the data displayed in the controls on the screen that are bound to that data source.
Have you checked out the BindingSource? It is an intermediary between your controls and your data source, and immediately reflects any changes made to the data source in the controls. To push it the other way, you invoke EndEdit. Then of course, you have to call Update on your adapter to push the changes down to the data source.
So you add a Binding Source (add the component to your form from the Data toolbox).
Set the data source of it to your data table.
myBindingSource .DataSource = myDataTable
Then bind your controls to the BindingSource.
myTextBox.DataB indings.Add(new Binding("Text", _ myBindingSource , "CompanyNam e", true))
myGrid.DataSour ce = myBindingSource
See if that gets you anywhere. And answer my question at the top; maybe I can recommend another solution.
I use the n-layer model, so all of the data I display on the screen is defined in Classes. I capture changes to them when the Property value is modified.
Robin S. ------------------------------------------------- "Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message news:ka******* *************** ********@gigane ws.com...
>>Still need an answer.
I made a workaround by creating an event under datatable and form subscribes to it and calls BindingManager. EndCurrentEdit but would like to know if there's another way.
Thanks,
Vlado
"RobinS" <Ro****@NoSpam. yah.nonewrote in message news:eO****** *************** *********@comca st.com... Did you figure out the answer to this, or are you still hanging? Because I have a pretty good idea, if you still need an answer...
Robin S. --------------------------- "Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message news:rp***** *************** **********@giga news.com... VB.Net 2005 and Datatable/TableAdapter. > "RobinS" <Ro****@NoSpam. yah.nonewrote in message news:9a**** *************** ***********@com cast.com... >Which version of .Net are you using? 2003 or 2005? >> >Robin S. >------------------------ >"Vlado Jasovic" <vladoDOTjasovi cATexcelleincDO Tcomwrote in message >news:4L*** *************** ************@gi ganews.com... >>Hello, >>> >>I'm using typed dataset for databinding to windows controls and I'm >>having some problems. >>> >>I'm trying to move all business logic to datatable column_changing >>events and the problem that I'm having is when I change some other >>column, control value doesn't update immediately until I call >>endcurren tedit on bindingmanager which doesnt happen until user >>click update button. >>> >>Here's my problem: >>> >>Private Sub BusinessPartner DataTable_Colum nChanging(ByVal sender As >>System.Ob ject, ByVal e As System.Data.Dat aColumnChangeEv entArgs) >>Handles Me.ColumnChangi ng >>Select Case e.Column.Column Name >>> >>Case Me.dbaColumn.Co lumnName >>> >>Me(0).cat egoryID = "changed_column " >>> >>End Select >>> >>> >>End Sub >>> >>> >>Now, unerlying dataset.datatab le(0).categoryI D is indeed changed >>but databound textbox control remains the same. >>> >>> >>> >>How can I force databinding.upd ate from dataset/datatable? >>> >>> >>> >>Thanks, >>> >>> >>> >>Vlado >>> >>> >> >> > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 during
design-time. Here is the design of my simple tables: (An example
since I can't post my...
|
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, depending on which menu item a
user selects. Each of these controls follows the same basic pattern: Get a
dataset from the database and then display the results using basic
databinding.
Everything works fine except that I'll occaisionally get an...
|
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 somehow concatenate this databinding expression, a
comma, and another databinding expression for the...
|
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 answered...
In 1.1 we always did our own myDataAdapter.fills and we liked that control
for lots of good reasons. Now the new DataSource (or is it a
TableAdapter:Dataset) automatically fills the Gridview. How can we control
that fill?
In a...
|
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 page life cycle.
In this example the event fires twice when a) GridView EnableViewState=False
and any image type control in the <columns/> element. When either
EnableViewState is set to true or the image button is removed, the event
fires once....
| |
by: Nathan Sokalski |
last post by:
I have a very simple UserControl which contains an Image and a Label, which
I use to display an image with a caption. I am using this control inside a
DataList, setting the two Public variables using attributes in the *.aspx
page. Everything displays great for the initial load, but whenever I try to
add or delete an item (I have controls to do this on the page), it does not
seem to be recieving any values for the public variables. Here is...
|
by: Owen Blacker |
last post by:
I've spent loads of time Googling to try to work this one out and I'm
sure it's something obvious.
I get an InvalidOperationException reading "Databinding methods such as
Eval(), XPath(), and Bind() can only be used in the context of a
databound control" when I start my page. Unless I'm missing something
obvious, this is *not* the same issue as the "2-way databinding
cascading lists" issue in...
|
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 generic type Field<T>
(see sample code).
public class Employee
{
public Field<stringForename
|
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 the row. Simple enough so far?
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |