Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Refresh Form?
Message
From
06/09/2005 12:25:40
 
 
To
06/09/2005 10:14:09
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01046996
Message ID:
01047058
Views:
9
This message has been marked as a message which has helped to the initial question of the thread.
Actually, Denis, your problem is with your DataBinding. There are two ways (two different syntaxes) to specify databinding for any control and this results in two distinct binding objects. The problem is that you can't mix and match ... you have to stay consistent throughout the form.

So, in other words, since you bound your DataGrid with:
        Me.DataGrid1.DataSource = pmks_dataset
        Me.DataGrid1.DataMember = "vbestbuy"
Then you have to use the following syntax with TextBoxes:
        Me.txtDecrypt.DataBindings.Add(New Binding("text", pmks_dataset, "vbestbuy.einst_prs"))
Instead of what you used:
        Me.txtDecrypt.DataBindings.Add(New Binding("text", pmks_dataset.Tables("vbestbuy"), "einst_prs"))
But if you had bound your grid with:
this.oGrid.DataSource = pmks_dataset.Tables("vbestbuy")
Then you use the syntax you were using for TextBoxes:
        Me.txtDecrypt.DataBindings.Add(New Binding("text", pmks_dataset.Tables("vbestbuy"), "einst_prs"))
Do you see the difference? See my .NET Tips column in the current issue of the UT Magazine (www.utmag.com).

~~Bonnie




>Hi,
>Easy question.. but...
>I have a form with DATAGRID and TEXTBOX.
>I'd like to skip DATAGRID records and refresh textbox.
>DataGrid has not events like AfterRowColChange... then
>I try to use CurrencyManager to insert CurrencyManager.Refresh.. but PositionChanged and CurrentChanged events not fire when I changing records in DataGrid... textbox still has value of first record..
>Which event fires when I change row in DataGrid? and how to update other controls on form
>
>
>Some code :
>
>
>        pmks_dataset = New DataSet
>        Me.OleDbDataAdapter1.Fill(pmks_dataset, "vbestbuy")
>        Me.OleDbDataAdapter1.SelectCommand.Connection.Close()
>        pmks_manager = CType(Me.BindingContext(pmks_dataset.Tables("vbestbuy")), CurrencyManager)
>        Me.DataGrid1.DataSource = pmks_dataset
>        Me.DataGrid1.DataMember = "vbestbuy"
>        Me.txtDecrypt.DataBindings.Add(New Binding("text", pmks_dataset.Tables("vbestbuy"), "einst_prs"))
>        pmks_manager.Position = 0
>        AddHandler pmks_manager.PositionChanged, AddressOf Me.PositionChanged
>        AddHandler pmks_manager.CurrentChanged, AddressOf Me.CurrentChanged
>
>
>
>Please help.
>THanks
>Denis.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform