Posted 8 August 2017, 10:40 am ESTi want to add some image for some cells in one of flex grid column.And also i want to set that image as a clickable image.how to add image to the cell?
Add Image for grid cell
Posted by: nilekapawan on 8 August 2017, 10:40 am EST
Replied 8 August 2017, 10:40 am ESTHi,
There are a couple ways to add images to a cell in the FlexGrid:
1. Use a CellTemplate to define the content of the cell.
Examples of using a cell template can be found in the FlexGrid101 sample "CustomCellsActivity".
This blog post explains how to use custom cells in Xamarin.Forms. The approach is similar in Android, except all implementation is in code.
2. Create a custom itemFormatter class and override the formatItem method. You will also need to set the FlexGrid's itemFormatter by calling the setItemFormatter() method and setting it to the custom ItemFormatter class.
private ItemFormatter myItemFormatter = new ItemFormatter()
public String formatItem(GridPanel gridPanel, FlexGridCanvasRenderEngine renderEngine, GridCellRange cellRange, Rect bounds)
// set cell content here
From a sample implementation, refer the FlexGrid101 sample "OnDemandActivity".