Rad Grid View and PersistenceManager

0 Answers 104 Views
GridView PersistenceFramework
John
Top achievements
Rank 1
John asked on 29 Jun 2022, 03:39 PM

We have a strange issue that I've not seen posted or reported anywhere after two days of research

We have RadGridViews where we manage persistence using the Telerik PersistenceManager Class.

The grids are set as follows

    theGrid.ShowGroupPanel = false;
    theGrid.FilteringMode = Telerik.Windows.Controls.GridView.FilteringMode.FilterRow;
    theGrid.CanUserGroupColumns = false;
    theGrid.CanUserReorderColumns = true;

We gather data from a web service in the form of a data table and bind to the Grid.

When a filter is applied at the column level (for example a part number using the "Is Equal To"  filter) we save the grid stream, submit the query, retrieve the data, bind to the grid, Reload using the persistence manager.  

pseudo code

 

  • Gather Filter info
  • Save aStream
  • Get Data
  • Bind
  • PersistenceManager.Load(theGrid, astream);

The strange behavior is that I can consistently filter on a particular part number (String) and everything works as expected (A single result in the grid), but another part number results in a blank grid after calling the Manager.Load() code.  

In the second scenario, the underlying data table has one row, but it does not display in the grid.  If I comment out the code to load, then the value displays.  Using this, we lose the persistence, and can't "Clear filter" at the column level.

Long story short, the PersistenceManager.Load(theGrid, astream); seems to be failing, resulting in a blank Grid even though the underlying data table has one row.  Since this is Telerik code, we have no way to debug it.

 

Thanks in advance for any help.  I've attached a screen shot of the resulting grid, when the "Load" fails

Dilyan Traykov
Telerik team
commented on 04 Jul 2022, 12:41 PM

Hello John,

I tested the behavior you described with the GridView Serialization demo from our SDK Samples Browser, however, the filtered data is correctly loaded at my end.

I'm attaching the project in question to my reply for your reference. Can you please have a look at it and led me know if I'm missing something of importance?

If possible, please modify the project to demonstrate the issue you observe and send it back to me so that I can further investigate.

John
Top achievements
Rank 1
commented on 05 Jul 2022, 11:54 AM

Thanks for the sample.  I'll see if I can re-create it in the sample provided.

My description above is the simplified version, but we're intercepting the grd_FilterOperatorsLoading to remove certain filters, intercepting _Filtering to create a string filter to pass to the web service, saving persistence on the _filtered event, etc....

Anyway, it's weird that it sometimes works, sometimes doesn't.


Thanks.

Dilyan Traykov
Telerik team
commented on 05 Jul 2022, 04:07 PM

Hello John,

Indeed, it is strange that the persistence of the filters works only in some cases. As it works successfully in the sample project, however, I assume this may be caused by some other custom logic.

With this said, please let me know if you manage to isolate this in the sample project and I will gladly investigate further.

John
Top achievements
Rank 1
commented on 07 Jul 2022, 09:20 AM

It seems that there was an issue with the underlying data.  I can only assume there was unprintable characters in the data from the database.

The way I fixed the issue was to update the data in the DB, then the filtering worked.

For example, I took a know value that wasn't working (Part number 10005AB) and just ran an update statement like this

Update parts set part Number = '10005AB' where ID = 22

and then all of a sudden the filtering worked.  Strange indeed.  I did this same methodology with a few other know items that exhibited this behavior, and they all started working. 

Anyway, thanks for the assistance.  If I could determine exactly what the offending characters/HEX value, etc was, I'd share so the team a Telerik could play around with it.

Dilyan Traykov
Telerik team
commented on 07 Jul 2022, 02:54 PM

Hello John,

I'm glad to hear that you were able to resolve the issue. Indeed, if you manage to trace the offending values and reproduce this in a small sample project, we'd be more than happy to investigate further.

John
Top achievements
Rank 1
commented on 07 Jul 2022, 05:16 PM

Just reporting here, that I figured out exactly what was happening, which can be reproduced in your example.

Simply take a customer ID in your sample XML dataset and add a single space to the end of it

  • <CustomerID>ALFKI</CustomerID>
  • <CustomerID>ALFKI  </CustomerID>

With a single trailing blank space, the "Is Equal To" Column filter does not work if you typed in ALFKI (With out the trailing blank space)

Not sure if this is working as designed, but I'm guessing the user base would be better served if the underlying dataset were "Trimmed", or the internal workings of the persistence save/load/filter would not use trailing spaces in it's filter.

Either way, at least we now now what this issue is and can account for it.  Thanks for the assistance.

One more thing, I upgraded your sample project to use the following versions of the controls, as well as targeting the .NET 4.6.2 framework.

  • \lib\RCWPF\2021.3.1109.45.NoXaml\Telerik.Windows.Controls.Navigation.dll
  • \lib\RCWPF\2021.3.1109.45.NoXaml\Telerik.Windows.Controls.GridView.dll
  • etc......
Dilyan Traykov
Telerik team
commented on 08 Jul 2022, 12:57 PM

Hello John,

Thank you very much for sharing your findings.

Given this information, the observed behavior is expected and is by design when using the Is Equal To operator. Changing this at our end by trimming the searched string may prove to be a breaking change for our clients as in some cases you may also want to include the whitespace in the searched text to distinguish between "ALFKI" and "ALFKI Extended", for example.

With this said, we'd rather leave this for the developers to customize per use case if needed.

Nonetheless, I hope you've now achieved a viable solution at your end. If I can further assist you with anything else, please let me know.

John
Top achievements
Rank 1
commented on 08 Jul 2022, 01:49 PM

Thanks for all the help Dilyan...

No answers yet. Maybe you can help?

Tags
GridView PersistenceFramework
Asked by
John
Top achievements
Rank 1
Share this question
or