473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Does Property return a reference to the classes object?

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
1 1226
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
11
by: Aaron Queenan | last post by:
Given the classes: class Class { public static implicit operator int(Class c) { return 0; } } class Holder
4
by: Gary12009 | last post by:
Hello All, I have two classes, only the type of one of the properties is different. How should I declare the two classes? For example: I want to declare 2 Classes, named MySQLIntfield and...
10
by: Goran Djuranovic | last post by:
Hi all, Does anyone know how to declare a variable in a class to be accessible ONLY from a classes instantiated within that class? For example: ************* CODE ***************** Public...
18
by: cj | last post by:
members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe. I'm under the impression before you can use a class you have to make an...
8
by: Al | last post by:
I'd like to create Class Library in VB 2005, which has a property accessible by external programs. I decided to include 1 Class with 1 property in this project. I placed this code in Class:...
9
by: pamelafluente | last post by:
Hi, I was "studying" the famous (public code) BusyBox. I see the instruction: var busyBox = new BusyBox as in var busyBox = new BusyBox("BusyBox1", "busyBox", 4, "gears_ani_", ".gif",...
3
by: Sorrow | last post by:
I was watching a javascript presentation and one of the slides had the following code: <code> String.prototype.supplant = function( o ) { return this.replace(/{(*)}/g, function( a, b ) { var...
34
by: raylopez99 | last post by:
What is the state of C#? Somebody in a Linux advocacy newsgroup implied it has saturated (leveled off in growth). Note the 'hard code' pre-Wizards coding wizard Charles Petzold does C# only now....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.