Saving by PersistenceManager but missed Converter and StringFormat

3 posts, 0 answers
  1. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 03 May Link to this post

    Hi,

    I'm saving by PersistenceMaganer on my GridView but when I try to reload it missed converter and formatstring in some column.

    When reloading it doesn't apply Converter called FuoriCorsoConverter and StringFormat of "Last Update" column, durthermore other column with StringFormat is correctly applyed instead.

    Why?

    Codes:

    //Portions of code for saving
    PersistenceManager manager = new PersistenceManager();
    var streamGridView = manager.Save(this.DocumentHostGridView);
    //[...]
     
    //Portion of code for loading
    //[...]
    private void LoadPersonalizzazione()
    {
        //Personlizzazione del docking
        var stream = ViewModel.CaricaPersonalizzazione(this.GetType().ToString()); //ref. UserControl.xaml.cs
        if (stream != null)
            this.MainRadDocking.LoadLayout(stream);
     
        //Personalizzazione della gridview principale
        MemoryStream streamGridView = ViewModel.CaricaPersonalizzazioneControllo(this.GetType().ToString(),
            this.DocumentHostGridView.Name);
        if (streamGridView != null)
        {
            streamGridView.Position = 0L;
            PersistenceManager manager = new PersistenceManager();
            manager.Load(this.DocumentHostGridView, streamGridView);
        }
    }
    //[...]

    XAML of columns

    <telerik:GridViewDataColumn Header="Last Update" DataMemberBinding="{Binding UltimoAggiornamento, StringFormat={}{0:dd/MM/yyyy}}"/>
    <telerik:GridViewImageColumn Header="Out" DataMemberBinding="{Binding FuoriCorso, Converter={StaticResource FuoriCorsoConverter}}"/>

  2. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 05 May Link to this post

    Hello Potito,

    I prepared a sample application with which I tried reproducing such malfunction, but to no avail. Can you please check it out? Moreover, can you please share some details on how the implementation differs from the one in your application? It would be quite useful if you can modify the demo project as per your exact project setup, so that the issue can be reproduced, and send it as an attachment in a new support thread.

    Regards,
    Stefan X1
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 06 May in reply to Stefan X1 Link to this post

    I noticed that you used, I'll try to use this approach

    ServiceProvider.RegisterPersistenceProvider<ICustomPropertyProvider>(typeof(RadGridView), new GridViewCustomPropertyProvider());

Back to Top