This is a migrated thread and some comments may be shown as answers.

Advice on column reuse

2 Answers 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Geoff Smith
Top achievements
Rank 1
Geoff Smith asked on 30 Jul 2010, 12:44 PM
I was wondering if anyone has a nice strategy to re-use XAML column definitions, i.e. a GridViewDataColumn?

One way to do it is to create a class that inherits from GridViewDataColumn and set the various properties needed. However, this means you can't have any XAML and any custom CellTemplate will get messy.

If anyone has any ideas or links to resources that would help, please let me know!

2 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 02 Aug 2010, 12:27 PM
Hi Geoff Smith,

You can try the following: when you define the column definitions - select them with the mouse and drag and drop over the Toolbox. This will create a new toolbox item, which you can later rename to let's say "Column Definitions". Next time you just drag and drop from the toolbox to the XAML file and you will have the same column definitions in place.

I hope I understood your requirement correctly.

Kind regards,
Veskoni
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Geoff Smith
Top achievements
Rank 1
answered on 02 Aug 2010, 12:30 PM
Ah that's interesting. I think what I ended up doing was a manual version of that, so I created a user control, but replaced the UserControl element in the XAML file with GridViewDataColumn, essentially creating a subclass of the GridViewDataColumn. Bit of an OO hack really, but nice because I can reuse my more complex column definitions with a single line of XAML now.
Tags
GridView
Asked by
Geoff Smith
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Geoff Smith
Top achievements
Rank 1
Share this question
or