Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Issue with DataTemplate and Persistence Framework

$
0
0
Hi Michael,

The persistence framework does not persists DataTemplates and other properties that contains complex objects. You can find the persisted types in the Getting Started help article.

To resolve this you can define the DataTemplate in the application's resources and when you load the gridview, set the template manually. Here is an example:
<Window.Resources>
    <DataTemplate x:Key="cellTemp">
        <Button Content="Test" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
    </DataTemplate>
</Window.Resources>

IsolatedStorageProvider provider = new IsolatedStorageProvider();
provider.LoadFromStorage();
this.grdTest1.Columns[0].CellTemplate = this.Resources["cellTemp"] as DataTemplate;

You can also take a look at Custom Property Provider help article and the GridView Serialization example.

Please let me know if you need any further assistance.

Regards,
Martin
Telerik
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 Feedback Portal and vote to affect the priority of the items

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>