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
close icon

SfDataGrid cannot be displayed (exception thrown)

When I try to integrate the SfDataGrid without any binding to ItemsSource property, the App starts normally, but when I try to bind to my data the App crashes with an unhandled exception. The content of the exception is:

System.NullReferenceException at Syncfusion.UI.Xaml.Grid.SfDataGrid.UpdateRowAndColumnCount(Boolean canGenerateVisibleColumns) at Syncfusion.UI.Xaml.Grid.SfDataGrid.OnApplyTemplate()

 

The usage of the control is as follows:

<grid:SfDataGrid ItemsSource="{Binding Model.Orders}"/>

The binding works perfectly fine with other DataGrids (eg. from Telerik or with a standard ListBox).

 


4 Replies

PS Prakash Selvaraj Syncfusion Team February 25, 2013 10:20 AM UTC

Hi Pascal,

Thanks for using Syncfusion products.

We have analysed your query. When you bind an empty collection as ItemsSource to DataGrid, then you have to specify the SourceType for the DataGrid as shown in the following code snippet.

 Code Snippet [C#] :

this.grid.SourceType = typeof(Order);

 

Please let us know if you need further assistance.

Regards,

Prakash S.



IS Ihab Salem February 25, 2013 10:26 AM UTC

if the collection is empty then the data grid should not throw an exception for sure..this is a bug

Will this be fixed in a future update?


PS Prakash Selvaraj Syncfusion Team February 26, 2013 11:10 AM UTC

Hi Ihab,

Sorry for the inconvenience caused.

You can avoid the exception by using the snippet given in above response for now. Surely, We will fix this issue in our upcoming release.

Regards,

Prakash S.



PS Prakash Selvaraj Syncfusion Team May 27, 2013 05:59 PM UTC

Hi Ihab,

We are glad to announce that our  Essential Studio Vol 2 2013 is rolled out and is available for download under the following link

 

http://www.syncfusion.com/support/forums/general/108998/Essential-Studio-2013-Volume-2-Final-Release-v112025-available-for-download-

 

 Please find the release notes in the following link

https://s3.amazonaws.com/files2.syncfusion.com/Installs/v11.2.0.25/ReleaseNotes/WinRT.html

 

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

 

Regards,

Prakash S.



Loader.
Live Chat Icon For mobile
Up arrow icon