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

[Solved] Unload RowDetails ?

2 Answers 169 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jim
Top achievements
Rank 1
Jim asked on 19 Oct 2009, 09:36 PM
I have data that I dynamically load when a user selects a particular row in my gridview.  I have defined a RowDetailsTemplate and everything seems to work very nicely.

Somewhat arbitrarily an event occurs that causes much of my data that is showing in the row details to become invalid.  Is there a way to "invalidate" or "unload" the associated row details for a gridview?

I have an alternative solution to my problem but it seems heavy handed if I am simply missing some piece of existing functionality.

Thanks !

2 Answers, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 21 Oct 2009, 10:56 AM
Hi Jim,

If you assign null or another template the old DetailsElement will be unloaded and the new one will be loaded. Which I think is what you are after.

private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
    // You can do it for the whole grid
    var template = this.clubsGrid.RowDetailsTemplate;
    this.clubsGrid.RowDetailsTemplate = null;
    this.clubsGrid.RowDetailsTemplate = template;
 
    // Or you can do it on a per row basis using the Row's DetailsTemplate property.
}

I have prepared a small sample project and attached it. I hope it helps. Let me know if this is not what you are after.

Kind regards,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jim
Top achievements
Rank 1
answered on 21 Oct 2009, 02:23 PM
yes, that works just fine.  Thank you !
Tags
GridView
Asked by
Jim
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Jim
Top achievements
Rank 1
Share this question
or