views:

16

answers:

1

I have a DataTable-Property:

Public Property Files() As DataTable Implements Presenter.ISearchSetup.Files
    Get
        Return _files
    End Get
    Set(ByVal value As DataTable)
        _files = value
        RaiseEvent OnPropertyChanged()
    End Set
End Property
Private WithEvents _files As DataTable

Now I add a row with:

Dim row As DataRow
row = Me.Files.Rows.Add()
row.Item("Directory") = "C:/"
row.Item("Files") = 3

But the application raised the TableNewRow-Event only once at the beginning. If I execute the Me.Files.Rows.Add()... etc.. nothing happened.

+1  A: 

try this

Dim row As DataRow = Me.Files.NewRow()
 row("Directory") = "C:/"

 row("Files") =  3

Me.Files.Rows.Add( row)
Vyas