Forum Xamarin Xamarin.iOS

Xamarin iOS display detail from UITableview Button

I m doing a Xamarin iOS project. I have a UITableView I wan't to select a row when I click in a button and display the information linked to the cell selected. Like this :

I don't know how to pass data from the first controller to the second when I clicked on the button. How can I do that ?

Here is my TableDataSource :

private const string cellIdentifier = "ProductCell";

private ProductListViewController _controller;
private List<Product> _products;

public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
            ProductCell cell = (ProductCell)tableView.DequeueReusableCell(cellIdentifier);

            if (cell == null)
                cell = new ProductCell(new NSString(cellIdentifier));

            var record = _products[(int)indexPath.Row];
            cell.UpdateCell(record.Image, indexPath.Row);
            cell.Tag = indexPath.Row;

            return cell;

Here is my product custom cell :

public partial class ProductCell : UITableViewCell
        public static readonly NSString Key = new NSString("ProductCell");

        public ProductCell(IntPtr handle) : base(handle)

        public ProductCell(NSString cellId)

        public void UpdateCell(string imageName, nint tag)
            this.ProductImage.Image = UIImage.FromBundle(imageName);
            this.MoreBtn.Tag = tag;


  • PrashantRamiPrashantRami USUniversity ✭✭

    override RowSelected() in your TableDataSource class.

    public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
    //your code here
    tableView.DeselectRow(indexPath, false);

Sign In or Register to comment.