How do I display a list of data without using a list view and binding in xaml

Lucas_1992_LucasLucas_1992_Lucas ARMember
edited March 31 in Xamarin.Forms

I'm trying to display a list of objects that is contained in another list but the result is an exception, I want to do this


<ListView.ItemTemplate>






<ListView.ListTemplate>







</ListView.ListTemplate>





</ListView.ItemTemplate>

Tagged:

Posts

  • sivabhavanisivabhavani USMember ✭✭

    we can binding using the content view ..

    1. need to design a view by using content view
    2. if your using grid/staklayout/relative layout -- add that view to this layout
    3. like
    4. for (var i = 0; i < lstfoldernamedetails.Count; i++)
              {
                  var item = new FileItemTemplate(); //contentview 
      
      
                  item.BindingContext = lstfoldernamedetails[i];
      
                  item.GestureRecognizers.Add(ItemTapped);
                  column.Children.Add(item);
              }
      
  • sivabhavanisivabhavani USMember ✭✭
    1. to get the selected item ...like this

      private async void OnGridTapGestureRecognizerTapped(object sender, EventArgs e)
      {
      //var detailslist = (Grid)sender;

              var selectedItem = (FilesData)((FileItemTemplate)sender).BindingContext;
      

      }

Sign In or Register to comment.