Groups | Blog | Home
all groups > dotnet windows forms databinding > january 2005 >

dotnet windows forms databinding : TextBox Binding



ng5000 NO[at]SPAM gmail.com
1/20/2005 9:28:15 AM

[quoted text, click to view]

Hi,

Are you using the CurrencyManager class? If not I suggest you give it
a go. The CurrencyManager is nothing to do with finance (as the name
suggests) but a very easy way of navigating, displaying and updating
data.

If you need more flexibility use the DataView object.

I've just finished reading ADO.NET by David Sceppa (MS Press). It's
very good and has really helped me on my way with ADO.NET.
Let me know how you get on.

Nick
Nice Chap
1/20/2005 2:47:45 PM
I set the Text Property of a databound textbox programatically but the
value is not getting transferred to the underlying dataset. Is there is a
way to force databinding to kick-in ? please...

DCraig
1/21/2005 9:53:32 AM

[quoted text, click to view]
I'm not sure what you mean by set the text box programatically, but it
sounds like you didn't bind the textbox to the dataset.

If you bind the textbox to the dataset then the currency manager will take
care of it for you, the dataset should be updated whenever the textbox loses
focus. There is a way to call it manually but it's much easier to let the
currencyManager handle it. As the other poster suggested, reading about the
Currency Manager is a good idea but I'd also suggest getting a handle on
databinding.

From help 'Consumers of data on Windows forms'

' Visual Basic
TextBox1.DataBindings.Add("Text", dataSet1, "Customers.FirstName")

hth;

David Craig.


AddThis Social Bookmark Button