Click here to Skip to main content
15,893,508 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to tell difference for 0.0 and Nothing for variable in vb.net 2005 Pin
Andraw Tang11-Aug-10 10:24
Andraw Tang11-Aug-10 10:24 
AnswerRe: How to tell difference for 0.0 and Nothing for variable in vb.net 2005 Pin
Dave Doknjas11-Aug-10 11:31
Dave Doknjas11-Aug-10 11:31 
GeneralRe: How to tell difference for 0.0 and Nothing for variable in vb.net 2005 Pin
Andraw Tang11-Aug-10 11:53
Andraw Tang11-Aug-10 11:53 
QuestionFix/Freeze Height of Detail section in Crystal Report from crystal report {SOLVED] Pin
εїзεїзεїз10-Aug-10 20:44
εїзεїзεїз10-Aug-10 20:44 
AnswerClarity Pin
David Mujica11-Aug-10 2:56
David Mujica11-Aug-10 2:56 
GeneralRe: Clarity Pin
εїзεїзεїз11-Aug-10 3:14
εїзεїзεїз11-Aug-10 3:14 
GeneralRe: Clarity Pin
Goutam Patra11-Aug-10 22:46
professionalGoutam Patra11-Aug-10 22:46 
QuestionINotifyPropertyChanged works fine with a DataGridView, but not with a single databound textbox. Why ? Pin
David Mujica10-Aug-10 10:49
David Mujica10-Aug-10 10:49 
I've created a class which Implements the INotifyPropertyChanged event and raises that event when a data member in the class is changed.

On my form, (form3), I have:
1) BindingSource
2) BingingSourceNavigator
3) DatagridView
4) Textbox boound to the "LastName" datamember of the BadgeHolder class
5) A button which sets the first occurrence of LastName in the BindingSource Datasource to "Smith"

When I click the button, the DataGridView is automatically updated with the value of Smith. Cool !

Why doesn't the Textbox get the update ?

If I move to the next record using the BindingSourceNavigator button, then I navigate back to the first record, the Textbox has the value of "Smith". Which is correct.

Why doesn't the Textbox automatically update like the DataGridView since they are both connected to the same BindingSource ? Confused | :confused:

Thanks.

Public Class BadgeHolder

    Implements INotifyPropertyChanged

    Public Event PropertyChanged As PropertyChangedEventHandler _
       Implements INotifyPropertyChanged.PropertyChanged

{blah, blah more class stuff ...}



Public Class FORM3

    Private Sub FORM3_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Me.BadgeHolderBindingSource.DataSource = BadgeHolder.FILL
        Me.DataGridView1.DataSource = Me.BadgeHolderBindingSource

        Me.TextBox1.DataBindings.Add("Text", Me.BadgeHolderBindingSource.DataSource, "LastName", False, _
            DataSourceUpdateMode.OnPropertyChanged)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim BHList As BindingList(Of BadgeHolder) = _
            CType(BadgeHolderBindingSource.DataSource, BindingList(Of BadgeHolder))

        BHList(0).LastName = "Smith"

    End Sub

End Class

QuestionVB Script Pin
protocol4619-Aug-10 23:52
protocol4619-Aug-10 23:52 
AnswerRe: VB Script Pin
Scubapro10-Aug-10 19:23
Scubapro10-Aug-10 19:23 
AnswerRe: VB Script Pin
protocol4614-Sep-10 1:27
protocol4614-Sep-10 1:27 
QuestionHow do I get a custom context menu to show up??? Pin
thebiostyle9-Aug-10 16:43
thebiostyle9-Aug-10 16:43 
AnswerRe: How do I get a custom context menu to show up??? Pin
thebiostyle17-Aug-10 12:11
thebiostyle17-Aug-10 12:11 
GeneralRe: How do I get a custom context menu to show up??? Pin
thebiostyle22-Aug-10 5:27
thebiostyle22-Aug-10 5:27 
QuestionHow to check if tabpage control data loaded or not in vb.net 2005 Pin
Andraw Tang9-Aug-10 6:44
Andraw Tang9-Aug-10 6:44 
AnswerRe: How to check if tabpage control data loaded or not in vb.net 2005 Pin
Eddy Vluggen11-Aug-10 10:19
professionalEddy Vluggen11-Aug-10 10:19 
GeneralRe: How to check if tabpage control data loaded or not in vb.net 2005 Pin
Andraw Tang11-Aug-10 11:49
Andraw Tang11-Aug-10 11:49 
GeneralRe: How to check if tabpage control data loaded or not in vb.net 2005 Pin
Eddy Vluggen11-Aug-10 20:39
professionalEddy Vluggen11-Aug-10 20:39 
QuestionGrabbing file name and path info for a bootstrapper application Pin
normschaef9-Aug-10 6:12
normschaef9-Aug-10 6:12 
AnswerFileInfo Pin
David Mujica9-Aug-10 6:27
David Mujica9-Aug-10 6:27 
Questionreturn executable setup file path Pin
mehrnoosh8-Aug-10 20:22
mehrnoosh8-Aug-10 20:22 
AnswerRe: return executable setup file path Pin
Goutam Patra8-Aug-10 21:02
professionalGoutam Patra8-Aug-10 21:02 
GeneralRe: return executable setup file path Pin
mehrnoosh8-Aug-10 21:09
mehrnoosh8-Aug-10 21:09 
GeneralRe: return executable setup file path Pin
Goutam Patra8-Aug-10 21:30
professionalGoutam Patra8-Aug-10 21:30 
GeneralRe: return executable setup file path Pin
mehrnoosh8-Aug-10 22:05
mehrnoosh8-Aug-10 22:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.