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.
Unfortunately, activation email could not send to your email. Please try again.

Reloading/Re-binding sfDatagrid is messing up the layout

Thread ID:

Created:

Updated:

Platform:

Replies:

127997 Dec 23,2016 07:12 AM Dec 28,2016 02:00 PM Xamarin.Forms 4
loading
Tags: SfDataGrid
Emil
Asked On December 23, 2016 07:12 AM

I am not sure if it is know problem. But I dont encounter same problem on standard listview of xamarin.forms. If view is loaded and sfdatagrid is binded with the Items object. if i reloaded/rebind the list again without clearing it, Things get messy. items get into each other. if I have grouping, Grouping will also disapear. If this is known issue, I dont know how to clear the list without binding with null object. Do you know anything about it?
AutoGenerateColumns="False"
AllowSorting="True"
IsEnabled="True"
ColumnSizer="Star"
AllowSwiping="True"
MaxSwipeOffset="180"
GridTapped="dataGrid_GridTapped"
SelectionMode="{Binding GridSelectionMode}"
SelectionChanged="SuperSetSelectionChanged"
AutoExpandGroups="True"
AllowGroupExpandCollapse="True"
RowHeight="100" ItemsSource="{Binding Items}"
SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}" VerticalOptions="FillAndExpand">
....

Emil
Replied On December 23, 2016 08:46 AM

  <sfgrid:SfDataGrid  ScrollingMode="PixelLine"  x:Name="listItems"
                        AutoGenerateColumns="False"
                        AllowSorting="True"
                           IsEnabled="True"
                        ColumnSizer="Star"
                        AllowSwiping="True"
                        MaxSwipeOffset="180"
                        GridTapped="dataGrid_GridTapped"
                        SelectionMode="{Binding GridSelectionMode}"
                              SelectionChanged="SuperSetSelectionChanged"
                         AutoExpandGroups="True"
                          AllowGroupExpandCollapse="True"
                        RowHeight="100" ItemsSource="{Binding Items}"
             SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}"  VerticalOptions="FillAndExpand">

Ashok N [Syncfusion]
Replied On December 27, 2016 06:02 AM

Hi Emil, 

Thanks for contacting Syncfusion support. 

We are able to reproduce the reported problem. Currently we do not have support for maintaining the old values while we change the Items. We will provide the support for maintaining the old values while we change the Items in our upcoming 2016 Vol 4 SP release, which will be rolling out within this week. We will update you once the release rolls out.  

Note: If we want to maintain the Grouping while we change the new items, we need to add that grouped column by manually. And we need to set the SfDataGrid.AutoGenerateColumnsMode as other than ResetAll. 

Regards, 
Ashok 


Emil
Replied On December 27, 2016 10:38 AM

Is that the reason why there is special filtering on sfdatagrid (https://help.syncfusion.com/xamarin/sfdatagrid/filtering) ? because I am getting memory problem if I implement filtering using mvvm by simply filtering my binded ObservableCollection and Raising PropertyChanged event. I believe this is causing memory problem when it is raised several times. is there a simple way to handle this?


        public override void Find()
        {
            List<Item> foundItems;
            if (string.IsNullOrWhiteSpace(SearchText) == false)
                foundItems = AllItemTemplates.Where(p => p.name.ToLower().Contains(SearchText.ToLower())).ToList();
            else
                foundItems = AllItemTemplates;

            if (foundItems != null)
            {
                ItemTemplates = new ObservableCollection<Item>(foundItems);
                RaisePropertyChanged("ItemTemplates");
            }
        }

Ashok N [Syncfusion]
Replied On December 28, 2016 02:00 PM

Hi Emil, 
 
In our SfDataGrid we do not have support for columns level filtering and already we have logged this feature in our feature management system. So we have provides support to filter the records in view by setting the SfDataGrid.View.Filter property. Memory problem will not occurred while using this SfDataGrid.View.Filter. If you are facing the memory problem in you sample while using SfDataGrid.View.Filter? could you please share that sample along with replication procedure, that would be more helpful for further analyze. 
 
Regards, 
Ashok  


CONFIRMATION

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.

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.

;