Cell tapped in flex grid

Posted by: nilekapawan on 8 August 2017, 10:40 am EST

  • Posted 8 August 2017, 10:40 am EST

    I have created flex grid and added handler to cell tapped.I can do some work after tap the cell.But now problem is second time tap the same cell and handler is not working.Below i added my code.


    mGrid.getCellTapped().addHandler(mCellTapped,mGrid);

    private IEventHandler mCellTapped= new IEventHandler()
    {
    @Override
    public void call(Object arg0, Object arg1)
    {
    GridCellRangeEventArgs args = (GridCellRangeEventArgs) arg1;


    if (args.range.isValid())
    {

    if (args.range.col == 1)
    {
    Product pro =(Product) mGrid.getCollectionView().getItems().get(args.range.row);
    actionQtyClick(pro,mGrid.getRootView(), args.range.row);

    }
    }

    }
    };
  • Replied 8 August 2017, 10:40 am EST

    Hello

    Double tapping is considered a separate action with a different event:

    http://www.goxuni.com/docs/android/api/com/grapecity/xuni/flexgrid/FlexGrid.html#getCellDoubleTapped--

    You can either use this event to perform a similar action. The code should work in much the same way as what you've provided above, just with the substitution of getCellDoubleTapped instead.
  • Replied 8 August 2017, 10:40 am EST

    That is very helpful for my problem. I added same process to cellDoubleTapped function.Using that process add the new value that tapped cell.problem is that new value shown in the grid after tap another cell.i want to know about how to bind and show that new value in grid end of my process.
  • Replied 8 August 2017, 10:40 am EST

    If you move to another cell after performing some action to change the content you'll leave edit mode. It sounds like you're trying to prevent this from happening. You can refer to the EditConfirmation sample that displays a dialog after editing a cell:

    https://github.com/GoXuni/Android-Samples/blob/master/AndroidStudio/FlexGrid101/app/src/main/java/com/grapecity/xuni/samples/flexgrid/EditConfirmationActivity.java

    Cell Factory

    Rather than displaying a confirmation though, you'd simply be canceling the edit without an option. If you wanted to capture any changes you could do that here as well.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels