We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Sorting and filtering not working

Hi,

I am filling my SfTreeGrid using an ObserableCollection. This works like expected.

I am using the event .AutoGeneratingColumn to format one specific TreeGridTextColumn as a TreeGridDateTimeColumn column. This is my code.

If e.Column.MappingName.Contains(" (D)") Then
If TypeOf e.Column Is TreeGridTextColumn Then
Dim headername As String = e.Column.MappingName
e.Column = New TreeGridDateTimeColumn() With {
.MappingName = headername,
.AllowNullValue = True,
.Pattern = Syncfusion.Windows.Shared.DateTimePattern.ShortDate,
.AllowFiltering = True
}
End If End If

As said, this works usually, BUT:

Some records contain NULL for the above TreeGridDateTimeColumn().

If the first record is NULL in this TreeGridDateTimeColumn(), the SfTreeGrid shows me today's date. When I try to sort or filter, I get an exception.

If the first record is not NULL, the SfTreeGrid displays everything correctly. The value is displayed as an empty value, sorting and filtering are possible.


What is also strange, that the order of the columns is different.
Please find attached two screenshots showing the result. 


I tested this also with a SfDataGrid. I don't get an exception when using an SfDataGrid, but the rest of the behavior is the same. Again, I can't sort or filter if the first record of my ObserableCollection is NULL in the Date field.



Attachment: screenshots_b250563.zip

1 Reply

DM Dhanasekar Mohanraj Syncfusion Team April 26, 2023 02:00 PM UTC

Hi Marco Uffelmann,

We have checked the reported issue with the provided details. But we are unable to reproduce the reported issue on our end. The filtering and sorting work properly as expected. Here we have attached the tested sample and video demo. Please have a look at this. If you are still facing the reported issue, modify the attached sample based on your scenario and share the video illustration for the reported issue. It will be helpful for us to check on it and provide you with a solution as soon as possible.

Regards,

Dhanasekar M.


Attachment: Sample__TestedVideo_8adcf9d.zip

Loader.
Live Chat Icon For mobile
Up arrow icon