SfDataGrid 'NaN is not a valid value for height' error in Platform WPF

Hi,

I'm  displaying 2 data using 2 SfDataGrid's. There is no height set for the Datagrid, as the length of the data is unknown.

The logic is, that only 1 Datagrid is shown and the user can switch, whit a button. This works perfectly on Android.

I made a WPF "companion", as a desktop version is required. Everything seems to be working, but changing the visibility of the Datagrid crashes the application (hiding the 1st Datagrid and showing the 2nd Datagrid). 

Attached a sample, with the error.


Many thanks in advance,

Attila.


Attachment: SfDataGrid_ebb2f5a2.zip

5 Replies 1 reply marked as answer

SV Suja Venkatesan Syncfusion Team October 8, 2021 03:52 PM UTC

Hi Attila, 

Thank you for contacting Syncfusion support. 

We have checked the provided sample and the exception call stack. We would like to let you know that the call stack of exception is not from SfDataGrid. It seems the issue occurs due to the height of the GridLayout. We have made changes to the GridLayout height in the sample and it is working properly not. The modified sample is available in the following link for your reference. 


Please have a look at this sample and let us know if you have any concerns in this. 

Regards, 
Suja. 



AT Attila Toroczkai October 18, 2021 11:41 AM UTC

Hi Suja,


Sorry for late reply.

Yes, setting the middle row to Auto, dose fix the nan error, but now the buttons don't "stay" at the bottom, if the middle content is not overflowing. 

Tried setting options to FillAndExpand, but no success.

Still interesting that it works fine with * on Android and it crashes on WPF.

Is there another way? 


Regards,

Attila



SV Suja Venkatesan Syncfusion Team October 19, 2021 01:34 PM UTC

Hi Attila, 

Sorry for the inconvenience caused. 

We have made changes in the provided sample in layout of the Datagrid content page and it is working properly now, as like your requirement button at the stays in bottom when Datagrid content not overflowing. The modified sample is available in the following link for you reference. 


Please look at this sample and let us know if you have any concern. 

Regards, 
Suja. 


Marked as answer

AT Attila Toroczkai October 20, 2021 05:32 AM UTC

Hi Suja,


Thank you for your help, this works perfectly.


Regards,

Attila



SV Suja Venkatesan Syncfusion Team October 21, 2021 06:51 AM UTC

Hi Attila, 

Thanks for the update. 

Please let us know if you need any further assistance. 

Regards, 
Suja.

Loader.
Up arrow icon