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

Using the Grid Column Sizer in Auto Mode

Hi,

I'm currently attempting to use the sfDataGrid with the ColumnSizer set to Auto like so:

<syncfusion:SfDataGrid x:Name="dataGrid" ItemsSource="{Binding LandFormInformation}" FontSize="12" AllowGroup="True" AutoGenerateColumns="False"HorizontalContentAlignment="Stretch" IsGroupDropAreaExpanded="True" AllowResizeColumns="True" AllowSort="False" ColumnSizer="Auto">

<syncfusion:SfDataGrid.GroupColumnDescriptions>
<syncfusion:GroupColumnDescription ColumnName="Id"/>
</syncfusion:SfDataGrid.GroupColumnDescriptions>

The data binding is a IList<object> which has data at binding time.

Whenever the page loads it generates the following exception:

System.NullReferenceException
   at Syncfusion.UI.Xaml.Grid.GridColumnSizer.<>c__DisplayClass17.<SetSizeToHeaderWidth>b__13(DataColumnBase col)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Syncfusion.UI.Xaml.Grid.GridColumnSizer.SetSizeToHeaderWidth(GridColumn column)
   at Syncfusion.UI.Xaml.Grid.GridColumnSizer.SetGridSizerWidth(Double totalColumnSize, List`1 calculatedColumns, GridColumn lastColumn, Double viewPortWidth)
   at Syncfusion.UI.Xaml.Grid.GridColumnSizer.SetSizerWidth(Double viewPortWidth)
   at Syncfusion.UI.Xaml.Grid.GridColumnSizer.RefreshAll(Double AvailableWidth)
   at Syncfusion.UI.Xaml.Grid.GridColumnSizer.InitialRefreshAll(Double AvailableWidth)
   at Syncfusion.UI.Xaml.Grid.RowGenerator.ApplyColumnSizeronInitial(Double availableWidth)
   at Syncfusion.UI.Xaml.Grid.VisualContainer.ArrangeOverride(Size finalSize)
   at Windows.UI.Xaml.UIElement.Arrange(Rect finalRect)
   at Syncfusion.UI.Xaml.Grid.ScrollableContentPresenter.ArrangeOverride(Size finalSize)
   at Windows.UI.Xaml.FrameworkElement.ArrangeOverride(Size finalSize)
   at Windows.UI.Xaml.FrameworkElement.ArrangeOverride(Size finalSize)
   at Syncfusion.UI.Xaml.Grid.SfDataGrid.ArrangeOverride(Size finalSize)   at Windows.UI.Xaml.FrameworkElement.ArrangeOverride(Size finalSize)

 

Any help would be appreciated.

Thannks.


3 Replies

PS Prakash Selvaraj Syncfusion Team May 14, 2013 09:08 AM UTC

Hi Cliff,

 

Sorry for the inconvenience caused.

 

We have analysed your query. The reported issue was fixed in our Service pack which was rolled out on March 22nd 2013. Please upgrade to it to overcome this issue.

 

Please let us know if you need further assistance.

 

Regards,

Prakash S.



CC Cliff Cote May 14, 2013 06:33 PM UTC

Thanks,

I will download the patch.



PS Prakash Selvaraj Syncfusion Team May 29, 2013 05:24 AM UTC

Hi Cliff,

Thank you for your update. Please let us know if you need any other information.

Regards,

Prakash S.


Loader.
Live Chat Icon For mobile
Up arrow icon