views:

38

answers:

1

Is there a way to define a <Columns> outside of a GridView in my .aspx file such that I can use those <Columns> in multiple GridViews in the same page? I have two GridViews that will have the same DataSource type, just with different content, and I'd rather not repeat all my customized TemplateFields in each. This seems simple enough, it's just I'm new to ASP.NET. Coming from WPF, it feels like I should be able to define my <Columns> in some parent "Resources" area, define its TargetType, give it a key, and then reference that key wherever I want those <Columns> to appear.

A: 

Not sure if is what you want, but you can create custom GridViewColumns implementation and use it. Example

Elph