Howdy,
I have a class, TestRequest (BusinessBase), that contains a custom object _requestor as UserInfo. UserInfo is a ReadOnlyBase object that holds the requesting doctors first name, last name, and ID.
UserInfo’s behavior is its ability to represent the doctors name in almost any combination, first last or last, first.
I have created a UserInfoList (Readonly List Base) that can get a list of users -- GetDoctors.
I can set a datasource for this ComboBox and display a list of doctors to choose from.
How can I get the databinding to work so I can select an item out of this list and a UserInfo object be sent to the _requestor setter property?
Can an “Object” be selected from a combo box and bound to a property? Or do I have to use the UserInfo.ID and make my TestRequest use an Integer type for _requestor in place of UserInfo?
I hope I am asking the correct question here.
Thank you for any help you can provide.
Keith
Thank you. I don't think that I mentioned it on the original post, but does it make a difference if I am doing this on the web?
Keith
So you would vote for using an integer in my business object to hold the primary key of the doctors user record in place of a user object?
It would seem much more powerful to treat a doctor as an object instead of as an ID.
Keith
That is a good question. So you would advocate when dealing with “relational” objects to store the foreign key as an ID in place of storing the child object? Is there ever a case where you would want/need to use a Child Object in place of an ID?
I could make up a case for storing the Child Object here, but it would be weak… The “What If” I need to show the doctors name on the page in more than one place would require multiple database trips to get the Doctors name for each instance it is displayed, or create a temporary var to hold it once and use it over the rest of the page.
Thank you. I will transition my objects toward this frame of thought.
One of the reasons I wanted to use a custom object was so I could use a DataFormatString on the UI side to format the name in several standard formats. (First Last or Last, First or FL)
Would you know how to use the DataFormatString in this situation? As far as I know, the DataFormatString uses the objects ToString method that is overloaded.
Here is the other post: http://forums.lhotka.net/forums/thread/15307.aspx that you helped me on as well.
Keith
Copyright (c) Marimer LLC