This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I would like to get some tipp to have an easy way to support The DisplayNameAttribute and the ability to hide some fields (like the ids, loggint helper fields and so) from the display. Right now if i do a following query all entity fields are displayed in the grid. using(SomeUnitofWork uow = new SomeUnitofWork(context) { var qry = from o in uow.SomeEntities orderby o.Name where o.DeletedOn == null select o ; gridview1.datasource = qry.ToList() ; }
I search for the solution and the User guide says it isd better to implement extension properties. But the template files are ingnoring this question, so we end up to make some custom templates. I am very green in this template bussiness and searching some solution. Is there any repository where we can download/get etc some custom made templates ? even without any support? Is there any intention that those rather very needed and foundamental properties in UI design bussiness will get some love and designer support?
Regards Sandor
|
|
|
Extension properties only work in conjunction with custom templates -- the standard templates don't know anything about your extension properties. (If they did, they wouldn't be extension properties -- they'd be built in!) You can avoid having to customise the templates by entering the desired CLR attributes directly into the designer using the Custom Attributes setting. This is a bit more verbose than using an extension property, but does not require any messing with the templates. If your model is not too big, or if you are only using custom attributes on a few properties or entities, I would go this route. (You can reduce the verbosity a bit by importing the required namespaces (e.g. System.ComponentModel) -- View > Other Windows > LightSpeed Model, then right-click the root Model node in the tree and choose Add New Imported Namespace.) If you do feel it is worth using extension properties, I'm afraid there aren't any prebuilt examples of mapping these to DisplayNameAttribute or BrowsableAttribute, but there is info about using them in a custom template at http://www.mindscapehq.com/forums/Thread.aspx?PostID=5037 (though I think the same ground is also covered in the user guide so it may not be telling you anything new), and about custom templates at http://www.mindscapehq.com/blog/index.php/2009/09/16/customising-lightspeed-entity-templates/. |
|