SfDataGrid not displaying scrollbars if columns added manually

Ordinarily the SfDataGrid shows scrollbars as needed to allow user to scroll to see the last row or column. 

However I'm experiencing an issue where the SfDataGrid does not display any scrollbars if I am creating columns and binding
values manually at runtime.  I can't seem to find a way to trigger the scrollbars to appear automatically.

For example:

dg = new SfDataGrid();

for ( x = 1; x = 20; x++ )
{
    GridCheckBoxColumn x = new GridCheckBoxColumn();
    x. HeaderText =  x;
    x.ValueBinding = new Binding("some_value");

   dg.Columns.Add(x);

}

dg.ItemsSource = SomeCollection;


Any suggestions?

1 Reply

GT Gnanasownthari Thirugnanam Syncfusion Team November 24, 2017 12:20 PM UTC

Hi Milan, 

We are tried to reproduce the issue by creating SfDataGrid and adding ItemsSource and GridColumns for SfDataGrid at runtime based on your given code snippet but we are unable to reproduce it. For your reference we have attached the tested sample in below location. 


if it is possible please share the below needed details that will be helpful to provide appropriate solution at earliest. 

  1. We cannot understood how you are loading the SfDataGrid in your application (Whether loading SfDataGrid inside the Window or StackPanel or ScrollViewer etc..), so please share the details to us.
  2. If it is possible please share your application which reproduces the issue.
  3. Please share the code which is related to SfDataGrid.
  4. Otherwise please revert to us with modified above sample based on your application scenario.

Regards, 
Gnanasownthari T. 

 


Loader.
Up arrow icon