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)