How can i capture a starting & ending cordinates for selected cell range?

Posted by: chayankar209 on 30 May 2018, 4:38 am EST

  • Posted 30 May 2018, 4:38 am EST

    User will select cell range by clicking on a paticular cell & dragging the mouse upto desired cell. I want to get the cordinates of the selected cells (top left cell index & bottom right cell index)

    There are no such events which captures this action. Please suggest !!

    Thank you !! :slight_smile:

  • Posted 31 May 2018, 8:02 am EST

    Hi,

    You may use selectionChanged event to do so.

    Please refer to the following code snippet for the same.

    grid.selectionChanged.addHandler((sender,eventArgs)=>{
    var topRow=eventArgs.range.topRow;
    var leftCol=eventArgs.range.leftCol;
    var bottomRow=eventArgs.range.bottomRow;
    var rightCol=eventArgs.range.rightCol;
    });
    

    Here is a sample which implements the same:- https://stackblitz.com/edit/angular-muy8v7?file=app%2Fapp.component.ts

    ~Manish

Need extra support?

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

Learn More

Forum Channels