|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Data binding to an objecttext box to a read/write property of an object at design time? I see lots of examples to binding to a dataadapter etc, but if I have a class which represents a business object can I bind directly to the properties of the class? Regards Simon -- ================================ Simon Verona Dealer Management Service Ltd Stewart House Centurion Business Park Julian Way Sheffield S9 1GD Tel: 0870 080 2300 Fax: 0870 735 0011 Yes but only in VS2005. Older versions I don't think its possible...
There's new object data providers in 2005 although I haven't actually started using 2005 yet so not sure how, where, etc. Simon Verona wrote: Show quoteHide quote > I don't know if I'm missing something... but.. is it possible to databind a > text box to a read/write property of an object at design time? Ok thanks.. I'm still on VS2003.. It seems like an interesting omission.
As an aside, if I was to try and implement this by inheriting the textbox class (and perhaps some of the others) and have two additional properties called "object name" and "property name", could I then access the property through reflection? Would there be a performance penalty to pay to do this? Anybody give me a head start in terms of coding... ? Thanks in advance Simon -- Show quoteHide quote================================ Simon Verona Dealer Management Service Ltd Stewart House Centurion Business Park Julian Way Sheffield S9 1GD Tel: 0870 080 2300 Fax: 0870 735 0011 "Steven Nagy" <learndot***@hotmail.com> wrote in message news:1152156267.394770.70390@m79g2000cwm.googlegroups.com... > Yes but only in VS2005. Older versions I don't think its possible... > There's new object data providers in 2005 although I haven't actually > started using 2005 yet so not sure how, where, etc. > > Simon Verona wrote: >> I don't know if I'm missing something... but.. is it possible to databind >> a >> text box to a read/write property of an object at design time? > That would work. I wouldn't be able to comment on the performance of
reflection. I use it but have never clocked it. Wouldn't be too bad I suppose because you aren't talking about massive amounts of objects and form components right? Check out the System.Type class and all its methods for getting lists of fields and methods and so on to get started with reflection. But there might be an easier way. Perhaps you only need your object to implement an interface to databind. I haven't investigated this specifically, but what is the distinct attributes of the data table and data row that allow them to be data bound? Could your object inherit from these instead? Or is changing the object not possible? I assume you have checked out the BindingManager and all its uses? Steven Don't assume anything!! ;)
I've not checked out anything yet. I'm looking for the longer term... At the moment, some of my business logic is exposed in my user interface, mainly because because I need to bind to the raw data. I want to be able to remove all the business logic into a seperate set of classes, and then bind to the various properties instead - this will allow me to neaten my code up and remove lots of the business logic out of my UI (I've already done some of this by writing classes that partially handle the logic). I'm planning to migrate to VS2005 towards the end of the year, so I may just wait till then before I do this. Regards Simon -- Show quoteHide quote================================ Simon Verona Dealer Management Service Ltd Stewart House Centurion Business Park Julian Way Sheffield S9 1GD Tel: 0870 080 2300 Fax: 0870 735 0011 "Steven Nagy" <learndot***@hotmail.com> wrote in message news:1152225783.311467.250700@j8g2000cwa.googlegroups.com... > That would work. I wouldn't be able to comment on the performance of > reflection. I use it but have never clocked it. Wouldn't be too bad I > suppose because you aren't talking about massive amounts of objects and > form components right? Check out the System.Type class and all its > methods for getting lists of fields and methods and so on to get > started with reflection. > > But there might be an easier way. > > Perhaps you only need your object to implement an interface to > databind. I haven't investigated this specifically, but what is the > distinct attributes of the data table and data row that allow them to > be data bound? > Could your object inherit from these instead? Or is changing the object > not possible? > > I assume you have checked out the BindingManager and all its uses? > > Steven >
TreeView control checked based on if records exist
What exactly does it mean when they say CopyFile() and Progress Bar? CreateInstance and late binding what is best practice to populate large combobox? Somebody please help - Request for the permission of type 'System.Web.AspNetHostingPermission' [...] Q: Deleting a table with constraints No of files in folder VB 2005 Newbie - Binding? activate a click onto a picture button |
|||||||||||||||||||||||