ScrollToRowIndex does not work propper on UWP when using GridTemplateColumn

Hi

When I use GridTemplateColumn for a DataGrid Column ScrollToRowIndex function does not work proper on UWP

Steps to reproduce:
=Create project

* VS 2017 Create new Project => Cross-Plattform => Cross Platform App (Xamarin) => OK
* Master Detail / Xamarin Forms / PCL
 Xamarin Forms 2.3.4.247  UWP   Target Version : Windows 10 Creators Update (10.0 Build 15063)

= Create more Items in MockDataStore.cs line 80: 

            var _items = new List<Item>();
            for(int i =1;i<1000;i++)
                _items.Add(new Item { Id = Guid.NewGuid().ToString(),  Text = $"This is item {i}", Description = "The cats are hungry" });

= use Datagrid in  ItemsPage.xaml and add a button

 <xForms:SfDataGrid x:Name="DataGrid" ItemsSource="{Binding Items}" AutoGenerateColumns="True" AllowSorting="False" />
  <Button Text="Goto 2" Clicked="Button_OnClicked"/>

* Handle Click in ItemsPage.xaml.cs
 private void Button_OnClicked(object sender, EventArgs e)
        {
            DataGrid.ScrollToRowIndex(6);
        }

Start the App , sroll to end with mouse , click the Button => Everything works fine !!!

* Change Datagrid AutoGenerateColumns to false and create a GridTemplateColumn

  <xForms:SfDataGrid x:Name="DataGrid" ItemsSource="{Binding Items}" AutoGenerateColumns="False" AllowSorting="False" >
               
                <xForms:SfDataGrid.Columns  >

                    <xForms:GridTemplateColumn  MappingName="Text">
                        <xForms:GridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Label  Text="{Binding Text}"  />
                            </DataTemplate>
                        </xForms:GridTemplateColumn.CellTemplate>
                    </xForms:GridTemplateColumn>
                </xForms:SfDataGrid.Columns>
                
            </xForms:SfDataGrid>


start the App , sroll to end with mouse , click the Button =>  ScrollToRowIndex does not work , it jumps only two rows up


Wolfgang

BTW: Is there a way to Jump , not scroll to a specivic row ? (scrolling throw a long list will boring the user)             

4 Replies

AN Ashok N Syncfusion Team November 27, 2017 10:41 AM UTC

Hi Swo, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query and tested SfDataGrid.ScrollToRowIndex method with GridTemplateColumn, it was scrolled properly in both AutoGenerateColumns is true and false. For your reference we have attached our tested sample in the below location, please check it. Please modify our below attached sample based on your requirement and revert along with replication procedure. Otherwise, please share your sample or used collection type, model object type with SfDataGrid definition code snippet that would be more helpful for us to proceed further.  
 
 
Regards, 
Ashok 



SW swo November 28, 2017 07:27 PM UTC

Thanks for your Exampla, Unfortunately I does not scroll propperly in UWP!
* Start Application
*Scroll To the end by Mouse
*Click "ScrollRow"
=> 10003 is the first selected Row !!
*scroll to the end with mouse
*Click "ScrollRow"
=> 1006 is the first delected Row !! Thats fine !!
*scroll to the end with mouse
*Click "ScrollRow"
=> nothing happensd !!!

Wolfgang

BTW, not all lables are displayed properly(they are empty) but what I know thats an issue from the UWP Lable





Attachment: Master.UWP_28.11.2017_11_24_39_faa9c498.zip


SW swo November 28, 2017 09:05 PM UTC

Please take a look to the attached Video from the previous post


AN Ashok N Syncfusion Team November 29, 2017 04:40 PM UTC

Hi Swo,  
  
Thanks for sharing your tested video. We are able to reproduce the reported SfDataGrid.ScrollToRowIndex does not working in Xamarin.Forms.UWP for GridTemplatecolumn issue and fix for this issue will be available in our upcoming 2017 Vol 4 SP1 release , which will be schedule for roll out End of December, 2017.  
 
Regards, 
Ashok 


Loader.
Up arrow icon