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

PersistenceFramework vs. GridViewSelectColumn

3 Answers 82 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 17 Apr 2012, 10:36 AM
Hi guys,

I started working with the PersistanceFramework to save the settings of the RadGridView.
To check the items, we have inserted a GridViewSelectColumn on 1st position.

When we save the configuration and load it again, the checkbox in the header of the SelectColumn isn't a checkbox anymore.

In the header is now: System.Windows.Controls.CheckBox Content: IsChecked:False

Hope you can rebuild this "bug"?

Regards,

David

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 20 Apr 2012, 10:44 AM
Hello David,

As the RadGridView is a complex control, it cannot be persisted out-of-the-box. This is why in our demo solutions we demonstrated how a custom PropertyProvider can be defined for the RadGridView control.

The GridViewCustomPropertyProvider class holds the logic that determines the RadGridView persistence process. And in your case you need to examine the Columns Header property persistence logic implementation. You can find it in the ProvideValue() and RestoreValue() methods and you can modify it accordingly to your scenario.

I attached a sample solution where I persist the string representation of the RadGridView.Columns Headers or an empty string if the Header property is null. It works for my scenario so please give it a try and let me know if it works for you as well. Also, if your RadGridView definition is different and my approach doesn't work for you, please modify my solution to reproduce the issue, so that I can suggest another approach.

Greetings,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
bydt
Top achievements
Rank 1
answered on 30 May 2012, 09:02 AM
Hi Tina,

I am having similar problem but i have managed to display the header checkbox by changing header proxy type into object as following:

public class ColumnProxy
  {
      public string UniqueName { get; set; }
      public int DisplayOrder { get; set; }
      public object Header { get; set; }
      public GridViewLength Width { get; set; }
  }

However i find another issue after user settings has been loaded, the "select all" is not working (header of the gridview using GridViewSelectColumn). It seems restored grid is losing something. Could you please help me?

Thanks.
0
Tina Stancheva
Telerik team
answered on 04 Jun 2012, 08:31 AM
Hello Bayudita,

I attached a sample solution demonstrating how you can go about persisting the selection in the RadGridView control. However, it might be better to synchronize the selected items with your data context instead, using the approach described here.

Let us know if that information helps or if we can further assist you.

All the best,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
PersistenceFramework
Asked by
David
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
bydt
Top achievements
Rank 1
Share this question
or