ItemSwipeContentTemplate in C#

1 posts, 0 answers
  1. Muhammad
    Muhammad avatar
    7 posts
    Member since:
    May 2014

    Posted 11 May Link to this post

    HI, 

    I am trying to define listview ItemSwipeContentTemplate but via C#. Can someone help me convert the XAML declaration here to C# alternate.

     

    http://docs.telerik.com/devtools/xamarin/controls/listview/features/listview-features-cell-swipe

    THIS IS WORKING:
    <telerikDataControls:RadListView.ItemSwipeContentTemplate><DataTemplate><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="100"/><ColumnDefinition/><ColumnDefinition Width="100"/></Grid.ColumnDefinitions><Button Text="increase" TextColor="White" BackgroundColor="#FF9966" Clicked="IncreaseButtonClicked"/><Button Text="decrease" TextColor="White" BackgroundColor="#66CCFF" Clicked="DecreaseButtonClicked" Grid.Column="2"/></Grid></DataTemplate></telerikDataControls:RadListView.ItemSwipeContentTemplate>

     

    THIS IS NOT WORKING: 

    Productlist.ItemSwipeContentTemplate = new DataTemplate(typeof(Itemcell));

    public class Itemcell : ItemSwipeTemplateCell { public Itemcell() { Label text = new Label (){Text="Edit" }; this.View = text; } }


     

Back to Top