Telerik Forums
UI for WPF Forum
1 answer
266 views
I have been using Persistence Framework to save the state of RadGridViews. The RadGridViews have a column chooser which enables the user to change the visible columns (IsVisible=true/false). The WPF program saves the state of grids on exit, and loads them when the program starts. This works very well.

However, recently, as part of an update to the software, I had to remove a column definition from the XAML and the Data Model. I noticed that when the program was loaded again, the column still appears (because I had chosen it in my grid) but the values are all blank.

My question is:
Are there any best practices for using the Persistence Framework with new releases of my software? For example, a way to force an update/automatically remove the persisted data for a particular grid that changes?

Zarko
Telerik team
 answered on 22 Aug 2014
4 answers
330 views
In my gridview, I have a column that I need to make into a template as follows.
​ <telerik:GridViewDataColumn Header="Contact" DataMemberBinding="{Binding CustAccountsLocationContact.FirstName}">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding CustAccountsLocationContact.FirstName}" />
<TextBlock Text=" " />
<TextBlock Text="{Binding CustAccountsLocationContact.LastName}" />
</StackPanel>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>


When I save and reload with persistence framework, the binding no longer works. Is there a work around for this? or do I just need to add 2 columns?

Thank you,
Jonah
Jonah
Top achievements
Rank 1
 answered on 23 May 2014
1 answer
112 views
Hi,

    I am working on a Xbap application with the PersistenceFramwork (the latest version of WPF controls). It all work fine when I have only single xbap page, but if i have multiple pages in same application, it fails.

    After I assigned different page to the "Mainwindow.Content" and try to find those settings that I stored in previous page, it always return 0. But if I go back to previous page, I do get those settings.

    How can I retrieve those settings in different pages?

Code that I used:

  Dim m_isoStorageProvider As New Telerik.Windows.Persistence.Storage.IsolatedStorageProvider()
        Dim arrStorageFiles As New List(Of String)
        arrStorageFiles.Add("GridView1")
        arrStorageFiles.Add("GridView2")
        m_isoStorageProvider.LoadFromStorage(arrStorageFiles.ToArray)


Thanks
Chris

Zarko
Telerik team
 answered on 29 Jan 2014
3 answers
169 views
We have been using RadGridView for over a year, quite successfully. We had an old project that implemented the Persistence Framework (using PersistenceManager) and successfully saved/loaded layouts. Now, however, in a new project using the latest DLLs (2013.2.724) the save works fine (supposedly) but the load fails. The error message in the output window is "A first chance exception of type 'System.NullReferenceException' occurred in Telerik.Windows.PersistenceFramework.dll".

We compared streams after saving and after loading and they are identical - so insofar as the save is working correctly, it is persisting the layout to the stream and then loading it back.

We have downloaded samples from these forums and they do indeed work (in the sample) so no one is sure what is going on. The grid we're trying to save is fairly trivial, nothing special. No custom properties, no custom filters. In fact, we copied the Proxies.cs and RadGridViewCustomPropertyProvider.cs from the sample application and it still fails with the same error.

Any assistance would be greatly appreciated. Opened a support ticket on this as well, but have not heard back yet.

Steve
Dimitrina
Telerik team
 answered on 18 Dec 2013
2 answers
126 views
Hello.
We have a RadDocking control with multiple RadPanes in a RadPaneGroup.  Each RadPane contains a GridView.  We have an implicit style which works as expected.  The RadPanes are dynamically added to the RadPaneGroup on demand by the user.  Each time a RadPane is added the GridView is styled correctly.

When we implemented the PersistenceFramework we ran into an issue where the RadPane which is selected upon start-up gets the default style applied.  If I create a new RadPane it will be styled correctly as described.  I then save my layout and terminate the application.  When I start the application and we call  LoadLayout on the GridView and Load on the PersistenceManager.  And again that RadPane which is selected will have the default style applied to the GridView while the other RadPanes have the implicit style applied.

What would be a reason for this?

Thanks
Paul
Paul
Top achievements
Rank 1
 answered on 26 Aug 2013
1 answer
67 views
Are there some examples or hints to use the PersistenceFramework on a RadTabControl binded to a collection of the view model?
I would have to persiste the tabs and their contents.

Thanks in advance
Mauro
Pavel R. Pavlov
Telerik team
 answered on 02 Jul 2013
3 answers
149 views
Hi,

I've been experimenting a little with the PersistenceFramework over the course of the day and I've found some, according to me,
mystic behaviour.

When the window containing my RadGridView closes I run this code:
var manager = new PersistenceManager();
var stream = manager.Save(dgOrderOverview);
 
using (var fileStream = File.Create(System.AppDomain.CurrentDomain.BaseDirectory + "\\objstore.hf"))
{
    stream.CopyTo(fileStream);
}

and when I open it up again the following code is run:
//Check if any persistence file exists, and if so, load the view
if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + "\\objstore.hf"))
{
    var manager = new PersistenceManager();
 
    try
    {
        var fileStream = File.OpenRead(System.AppDomain.CurrentDomain.BaseDirectory + "\\objstore.hf");
        manager.Load(dgOrderOverview, fileStream);
        fileStream.Close();
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.WriteLine(ex.Message, "MYAPPNAME");
    }
}
 
//Load Context Menu
RadContextMenu ctxMenu = new RadContextMenu();
RadMenuItem item = new RadMenuItem();
 
foreach (Telerik.Windows.Controls.GridViewColumn column in dgOrderOverview.Columns)
{
    RadMenuItem sitem = new RadMenuItem() { Header = column.Header, IsCheckable = true, IsChecked = true };
    sitem.SetBinding(RadMenuItem.IsCheckedProperty, new Binding("IsVisible") { Mode = BindingMode.TwoWay, Source = column });
    ctxMenu.Items.Add(sitem);
}
 
RadContextMenu.SetContextMenu(dgOrderOverview, ctxMenu);

For the sake of things it should be noted that I have a RadContextMenu loading in order to be able to show/hide columns in the RadGridView.

Now, here's to the tricky bit, I have a RadContextMenu where the user can set the visibility of the columns, and IF the user ONLY uses this, everything is fine and dandy, visibility properties as set as they should upon reload. However IF the user decides to rearrange the columns, the next time he/she opens up the window, ALL columns are gone, there's NOTHING there at all.

So in short:
* Show / Hide columns using the RadContextMenu bound to the RadGridView works fine, persistence is kept and loads nicely.
* Rearrange columns and the persistence is broken and no columns as viewable upon opening the window.

As a little twist, the columns are all visible in the ContextMenu and their visibility are set as they should, but the GridView doesn't display them.

A little help, please?

P.S
I run the following version of the Telerik components:
RadControls_for_WPF_2013_1_0527_DEV_hotfix
D.S
Johannes
Top achievements
Rank 1
 answered on 14 Jun 2013
1 answer
258 views
Hi,

We are using Caliburn.Micro for MVVM Pattern, How to use Save & Load settings in ViewModel without written in code behind.

Thanks.
Zarko
Telerik team
 answered on 11 Jun 2013
1 answer
91 views
Hello everyone,
i wan't to safe and restore the expanded GroupRows in a GridView but I don't know how to force to expand the GridViewFooterRows.
Has anyone ever tried this and can show me an example how to do this?
Tina Stancheva
Telerik team
 answered on 03 Jun 2013
3 answers
107 views
Hello,

I've been trying out the Docker control and the persistence framework you provide. I must say I like how it works without requiring a lot of configuration. 

I'm having issues with the persisted full screen state. If I drag a pane that is float-able to my second monitor, where I make it full screen, upon reopening the application, the pane is made full screen on my main monitor. The same thing happens with the main window as well. 

If the window or pane isn't made full screen, the persisted layout works correctly.

Is this a bug or am I missing something? 
Thank you
Georgi
Telerik team
 answered on 26 Apr 2013
Narrow your results
Selected tags
Tags
+112 more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?