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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid UI not updated correctly

Thread ID:





132480 Sep 4,2017 09:09 PM UTC Sep 5,2017 06:08 AM UTC Xamarin.Forms 1
Tags: SfDataGrid
Gunnar Carlson
Asked On September 4, 2017 09:09 PM UTC

I have a fairly simple grid that doesn't behave as I expect. The problem is that the UI is not updated when the bound source is changed *unless* the grid is scrolled down to display the last row. Very odd.

The grid is bound to a custom class, and just to try things out I use the GridTapped event to increase a counter for the tapped cell and display it (hopefully) in the UI. I can see that I get the GridTapped event. I can see that I increase the correct counter and update it in the viewmodel. I can see that I get a RecordPropertyChanged event when the grid.view detect the change. But nothing is updated in the UI. *UNLESS*...

* If the grid is displayed in such a way that all rows fit on the screen, the UI is never updated no matter what I do.
* If the grid has more rows than what can be displayed on the screen, the UI is still static (i.e. no changes are displayed) as long as the last row is not displayed on screen.
* If the grid has more rows than what can be displayed on the screen AND the grid is scrolled down to display the last row, all updates to the cells (on all visible rows) are correctly displayed when the cell is tapped.

The MainPage code...

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"

        <local:UserList x:Name="viewModel"  />

        <syncfusion:SfDataGrid x:Name="dataGrid"
                               ColumnSizer="Star" ItemsSource="{Binding TheList}"

                <syncfusion:GridTextColumn MappingName="User1" TextAlignment="Center" DisplayBinding="{Binding User1.DisplayValue}">
                            <Entry HorizontalOptions="Center"></Entry>
                <syncfusion:GridTextColumn MappingName="User2"  TextAlignment="Center"  DisplayBinding="{Binding User2.DisplayValue}">
                            <Entry HorizontalOptions="Center"></Entry>
                    <syncfusion:GridTextColumn MappingName="User3"  TextAlignment="Center"  DisplayBinding="{Binding User3.DisplayValue}">
                            <Entry HorizontalOptions="Center"></Entry>
                <syncfusion:GridTextColumn MappingName="User4" TextAlignment="Center"  DisplayBinding="{Binding User4.DisplayValue}">
                            <Entry HorizontalOptions="Center"></Entry>
                    <StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="5" >
                    <Label Text="{Binding ResultName}" HorizontalOptions="Start" VerticalOptions="CenterAndExpand"></Label>



What am I doing wrong?

Ashok N [Syncfusion]
Replied On September 5, 2017 06:08 AM UTC

Hi Gunnar, 
Thanks for contacting Syncfusion support. 
We have checked your query and could you please confirm whether you are using ObservableCollection or List in your ItemsSource. Because if you use List does not provide the notification when the collection is changed but ObservableCollection provides notification when the collection is changed, also please implement INotifyPropertyChanged in your Model and ViewModel classes to CLR properties. Still you are facing the issue, please share your sample along with replication procedure, that would be more helpful for us to proceed further. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon