KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm displaying Business Object in generic DataGrids, and I want to set the column header through a custom attribute, like: class TestBo { [Header("NoDisp")] public int ID {get; set;} [Header("Object's name")] public String Name { get; set; } } So far, so good, but I'd also want to separate my display from my data, by inheritance: class TestBO { public int ID {get; set;} public String Name { get; set; } } class TestPresentationBO : TestBO { //Question: how to simply set the Header attribute on the different properties? } I see a solution via reflection with a SetCustomAttribute in the Child constructor, but it will be cumbersome, so is there a simple and elegant trick for this problem? Please prevent me from breaking the data/presentation separation ;o)
Tags (comma-separated)
Save Edits
Cancel