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

Object binding in Android

Thread ID:

Created:

Updated:

Platform:

Replies:

143295 Mar 13,2019 06:37 AM UTC Mar 22,2019 01:01 PM UTC Xamarin.Forms 4
loading
Tags: SfPopup
Eugen Dolgi
Asked On March 13, 2019 06:37 AM UTC

I have a listview with data.When clicking on an item, the popup will display details.On UWP works perfectly.On Android, the popup will show no data.


    <ContentPage.Resources>
        <ResourceDictionary>

           <DataTemplate x:Key="PopupDateTemplate">
                <ViewCell>
                    <StackLayout >
                               <!-- ... -->
                                <Label Text="{Binding UserName}"  />
                               <!-- ... -->
                    </StackLayout>
                </ViewCell>
            </DataTemplate>

        </ResourceDictionary>
    </ContentPage.Resources>

        <popuplayout:SfPopupLayout x:Name="PopupDate"  >
            <popuplayout:SfPopupLayout.PopupView >
                <popuplayout:PopupView ShowFooter="False" ShowHeader="False"  HeightRequest="350" WidthRequest="450"/>
            </popuplayout:SfPopupLayout.PopupView>
        </popuplayout:SfPopupLayout>

         <listView:SfListView x:Name="ListViewDate"
                              ItemsSource="{Binding Appointments}"
                              ItemTapped="ListViewDate_OnItemTapped">
          <!-- ... -->

private void ListViewDate_OnItemTapped(object sender, ItemTappedEventArgs e)
{
var appointment = e.ItemData as Appointment;
if (appointment != null)
{
   PopupDate.BindingContext = null;
   PopupDate.PopupView.ContentTemplate = null;
   PopupDate.BindingContext = appointment;
   PopupDate.PopupView.ContentTemplate = (DataTemplate)Resources["PopupDateTemplate"];
   PopupDate.Show();
}
}



Pradeep Kumar Balakrishnan [Syncfusion]
Replied On March 14, 2019 01:33 PM UTC

Hi Eugen , 
 
Thank you using Syncfusion controls. 
 
Currently, we are checking on the mentioned issue with “Items in popview is rendered in UWP but not working in Android “. We will validate and update you the details in two business days (March 18, 2019). We appreciate your patience until then. 
 
Regards, 
Pradeep Kumar B 


Pradeep Kumar Balakrishnan [Syncfusion]
Replied On March 19, 2019 06:21 PM UTC

Hi Eugen Dolgi, 
 
Thank you for your patience. 
 
We have checked the reported issue “Popup binding is not updated properly in Android but same code is works in UWP”. we can able to reproduce the reported issue on our side. We will validate the issue and provide you further details in one business days March 20,2019. We appreciate your patience until then. 
 
Regards, 
Pradeep Kumar B 


Sivaraman Sivagurunathan [Syncfusion]
Replied On March 20, 2019 04:02 PM UTC

Hi Eugen, 
  
We could able to reproduce the issue “Items in popview is rendered in UWP but not working in Android “. The binding context are updated in Forms.Android as similar to Forms.UWP, but if ContentTemplate is set from the resources of the page the values are not rendered. We are validating the issue and will update you the further details on 21st march 2019. 
The values can be updated if ContentTemplate has been set in the OnItemTapped event. Refer the below code for reference. 
  
  
private void ListViewDate_OnItemTapped(object sender, Syncfusion.ListView.XForms.ItemTappedEventArgs e) 
    var appointment = e.ItemData as DetailsContactInfo; 
    if (appointment != null) 
    { 
        PopupDate.BindingContext = null; 
        PopupDate.PopupView.ContentTemplate = null; 
        PopupDate.BindingContext = appointment; 
  
        var customTemplate = new DataTemplate(() => 
        { 
            var contactName = new Label(); 
            contactName.SetBinding(Label.TextProperty, new Binding("ContactName", BindingMode.Default, null, null, null, appointment)); 
  
            var contactNumber = new Label(); 
            contactNumber.SetBinding(Label.TextProperty, new Binding("ContactNumber", BindingMode.Default, null, null, null, appointment)); 
  
            var stack = new StackLayout(); 
            stack.Children.Add(contactName); 
            stack.Children.Add(contactNumber); 
  
            var viewcell = new ViewCell() 
            { 
                View = stack, 
            }; 
            
            return viewcell; 
  
        }); 
  
        PopupDate.PopupView.ContentTemplate = customTemplate; 
        PopupDate.Show(); 
    } 
  
  
Refer the below sample for more details. 

Regards, 
Sivaraman 


Subburaj Pandian Veluchamy [Syncfusion]
Replied On March 22, 2019 01:01 PM UTC

Hi Eugen, 
 
Thank you for your patience. 
 
We confirmed that the issue with “Binded values are not updated in ContentTemplate in Forms.Android and Forms.iOS” is a defect and we have logged a defect report. The fix for this issue is estimated to be available in the upcoming release 2019 volume 1 service pack 1 which is scheduled to be rolled by the end of April.  
 
You can track the status of the report by the following link, 
 
 
Regards,
Subburaj Pandian V 


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.

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

;