refresh previous page (grid) on back button after new data inserted in a child.

I have got a problem with refreshing prev. page when back button pressed. On the first (Parent): I have a SfDataGrid (programmatically added) and the button "add new". On tapped event I'll navigate to Update page and when back to parent- I can see than row data is changed. From Parent (pressing "Add" button) I go to Create page and insert data. When I save data, I see that it was added to DB but navigating back to Parent shows that my grid was not refreshed.
Could you please help me. Any advice will be appreciated.

my Parent activity:
using System;
using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using MobiLEMS.Core.ViewModel;
using MobiLEMS.Droid.Views.Styles;
using MobiLEMS.DTO.Base;
using MvvmCross.Droid.Views;
using Syncfusion.Data;
using Syncfusion.GridCommon.ScrollAxis;
using Syncfusion.SfDataGrid;
using Android.Content;
using System.Collections.ObjectModel;

namespace MobiLEMS.Droid.Views
[Activity(MainLauncher = false, NoHistory = false, AlwaysRetainTaskState = true, LaunchMode = Android.Content.PM.LaunchMode.SingleTask, WindowSoftInputMode = SoftInput.StateAlwaysHidden)]
public class ParentView : MvxActivity
private SfDataGrid _dataGrid;

    protected override void OnDestroy()
        _dataGrid.GridTapped -= GridTapped;

    [Android.Runtime.Register("onResume", "()V", "GetOnResumeHandler")]
    protected override void OnResume()

    protected override void OnRestart()

    protected override void OnCreate(Bundle bundle)
            Title = MobiLEMS.Resources.Properties.Resources.StrTitle;
            var myLayoutView = (TableLayout)FindViewById(Resource.Id.TableLayout2);
            _dataGrid = new SfDataGrid(BaseContext);

            GridTextColumn Column1 = new GridTextColumn
                MappingName = "CD",
                HeaderText = "CD

            GridTextColumn 1Column2 = new GridTextColumn()
                MappingName = "Qty",
                HeaderText = "Qty

            _dataGrid = new SfDataGrid(BaseContext)
                ItemsSource = ViewModel.DS,
                ColumnSizer = ColumnSizer.Star,
                GridStyle = new Dark(),
                AllowSwiping = false,
                SelectionMode = SelectionMode.Single,
                AutoGenerateColumns = false
            _dataGrid.AutoGenerateColumnsMode = AutoGenerateColumnsMode.None;

            _dataGrid.GridTapped += GridTapped;
        catch (Exception e)

public ObservableCollection LT { get; set; }
private void GridTapped(object sender, GridTappedEventArgs e)
var lt = e.RowData as LT;
if (lt != null)

    public new ParentViewModel ViewModel
        get { return (ParentViewModel)base.ViewModel; }
        set { base.ViewModel = value; }

    protected override void OnViewModelSet()
        SetContentView(Resource.Layout. ParentView);



Thank you!


  • MizanurRahman.0834MizanurRahman.0834 USMember ✭✭

    Use following line to refresh your Grid.


  • eakhmetovaeakhmetova Member

    Hello. Sorry, I was not able to answer earlier. Im really a new Mobil developer. And I'm not sure where I should implement it. Any advise?
    Thanks a lot.

Sign In or Register to comment.