By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

Does Property return a reference to the classes object?

P: n/a
I have a custom class with a Private DataTable member and a Public Property
that returns this DataTable in its Get call. Is the DataTable that is
returned from the Property's Get a reference to the class's Datatable?
I'm binding a DataGrid in my form as follows, but adding a row with the
bo.AddRow() method does not update what is in the DataGrid. Any
suggestions?

[Start Form]
Private bo as CustomBusinessClass
FormLoad()
bo = New CustomBusinessClass()
bo.initListing() '-- initializes datatable
FormGrid.SetBindings(bo.Listing, "")
End FormLoad()

ButtonClick()
bo.AddRow()
End ButtonClick
[End Form]

Public Class CustomBusinessClass
Private _listing as DataTable
Public ReadOnly Property Listing() as DataTable
Get
Return _listing
End Get
End Property

initListing()
...Fill the listing by creating a DataTable manually
end initListing

AddRow()
...Add row to _listing manually
end AddRow
End Class
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Disregard...
My problem is with resetting the DataTable in the Business Object, not in
the use of the Property to access the DataTable.

"nate axtell" <naxtell at progeny dot net>
I have a custom class with a Private DataTable member and a Public Property
that returns this DataTable in its Get call. Is the DataTable that is
returned from the Property's Get a reference to the class's Datatable?
I'm binding a DataGrid in my form as follows, but adding a row with the
bo.AddRow() method does not update what is in the DataGrid. Any
suggestions?

[Start Form]
Private bo as CustomBusinessClass
FormLoad()
bo = New CustomBusinessClass()
bo.initListing() '-- initializes datatable
FormGrid.SetBindings(bo.Listing, "")
End FormLoad()

ButtonClick()
bo.AddRow()
End ButtonClick
[End Form]

Public Class CustomBusinessClass
Private _listing as DataTable
Public ReadOnly Property Listing() as DataTable
Get
Return _listing
End Get
End Property

initListing()
...Fill the listing by creating a DataTable manually
end initListing

AddRow()
...Add row to _listing manually
end AddRow
End Class

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.