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

Create RowDetails in behind code

1 Answer 35 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gui
Top achievements
Rank 1
Gui asked on 03 Dec 2010, 11:03 AM
I want to create rowdetails in behind code page because the contents displayed in rowdetails are vary according to the value of each column in one row. I read the example about this from telerik but it is defined when initialize not runtime. So anyone can suggest me how to do it in behind code.

Thank you,
GUIde

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 07 Dec 2010, 12:06 PM
Hi Gui,

The RowDetailsTemplate property expects a DataTemplate. So you can build a DataTemplate at runtime and assign it to the property. You can build the XAML as a string an load it like this:

public static DataTemplate LoadTemplate(string xaml)
        {
            return (DataTemplate) XamlHelper.LoadXaml(xaml);
        }

The better approach would be to predefine all the available templates and then use the RowDetailsTemplateSelector in order to choose from them. This is demonstrated in this example.

I hope this helps.

Kind regards,
Ross
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
GridView
Asked by
Gui
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or