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