Syncfusion.SfDataGrid.XForms
Example 

SourceType Property (SfDataGrid)

Gets or sets the SourceType of the ItemsSource.
Syntax
public Type SourceType {get; set;}

Property Value

The type of the data source of SfDataGrid.
Exceptions
ExceptionDescription
Sometimes you may get this exception, if you get this exception, you need to set this property as given in the code example.
Remarks
The user can specify the type of ItemsSource in the SourceType property. The user may get the System.InvalidCastException sometimes when binding with complex data collections which can easily be handled by simply specifying the type of ItemsSource in the SourceType as given in the code example.
Example
dataGrid.SourceType = typeof(OrderInfo);
AssemblyVersion

Syncfusion.SfDataGrid.XForms: 17.2451.0.34

See Also