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

Setting RowDetailsTemplate programmatically

1 Answer 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tolga
Top achievements
Rank 1
Tolga asked on 20 Sep 2010, 06:16 PM
Hi:

I'd like to set/build the RadGridView's RowDetailsTemplate programmatically. Here is some code but I get an error message

"DependencyProperty Telerik.Windows.Controls.GridView.GridViewDataControl. RowDetailsTemplate cannot be set on an object of type System.Windows.DataTemplate."

detailsViewTemplate =

 

new DataTemplate();

 

detailsView =

 

new SearchDetails();

 

detailsView.DataContext =

 

this.GridView.SelectedItem;

 

detailsViewTemplate.SetValue(

 

RadGridView.RowDetailsTemplateProperty, detailsView);   //ERRORS out

 

 

 

this.GridView.RowDetailsTemplate = detailsViewTemplate;

thanks

--tolga

 

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 21 Sep 2010, 07:18 AM
Hi,

With this code you are trying to set value for RadGridView.RowDetailsTemplateProperty property on System.Windows.DataTemplate and since there is no such property you got the error. 

Sincerely yours,
Vlad
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
Tags
GridView
Asked by
Tolga
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or