utilitaire Posted August 22, 2005 Posted August 22, 2005 I have a file Templates.config that contains templates for my controls: <Template> <add Id="myTemplateDataGrid" Type="DataGridPreset" HeaderStyle-BackColor="#ffffff" BorderWidth="0" BackColor="#EEFBF0" GridLines="None" CellPadding="3" CellSpacing="0" Font-Name="Verdana" Font-Size="14pt" AlternatingItemStyle-BackColor="#DEF8E2" AutoGenerateColumns="false" /> </Template> I first put all these attributes in a list. This is Easy. After that, I want to merge these attributes to my current server control. Its goes like this: PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(myDataGrid); properties["borderwith"].SetValue(myDataGrid, 2); I can do that. The probleme comes with composed style. For instance: "AlternatingItemStyle-BackColor". I can't use this propertyName since its not ONE property. At this point, I find this buntch of code very complicated and I'm sure there a parser somewhere in ASP.NET that can do that for me. Have you ever heard of something that can do that? After all, asp.net has to parse all theses attributes when it loads the server control. Thank you Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.