We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

swipedRowindex is wrong when there is grouping

If I have grouping enabled using the code like in the documentation like below will not work because if i have 4 items and grouped as 2, it will consider as 6 I believe, If I actually swipe 3rd item from 4th item, it will have 5. so my grid looks like as below

---group1
      item1
      item2
---group2
    item 3
    item 4

In above case, if I swipe item 3, e.RowIndex=5 which makes no sense I believe as you cant swipe groupheader, or can you swipe group header to delete entire group( it will be even cooler solution:))

private void dataGrid_SwipeEnded(object sender, SwipeEndedEventArgs e)
{
    swipedRowIndex = e.RowIndex;

https://help.syncfusion.com/xamarin/sfdatagrid/swiping

3 Replies

AN Ashok N Syncfusion Team July 4, 2017 11:05 AM UTC

Hi Emil, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query and you can get the record index without considering the GroupCaption by resolving the record index with help of SfDataGrid.ResolveToRecordIndex method. Please refer the below code example  
 
private void dataGrid_SwipeEnded(object sender, SwipeEndedEventArgs e) 
{ 
    formView.BindingContext = e.RowData; 
    int recordindex = dataGrid.ResolveToRecordIndex(e.RowIndex); 
    swipedRowIndex = e.RowIndex; 
} 
 
Regards, 
Ashok 



EM Emil July 4, 2017 11:52 AM UTC

Hi Ashok,

thank you for that. this helps. another quick question, is there way to swipe group header to delete entire group?


thanks,

Emil



AN Ashok N Syncfusion Team July 5, 2017 10:27 AM UTC

Hi Emil, 
 
We are sorry about the inconvenience caused. 
 
In our SfDataGrid we cannot able to perform the swipe action on Group header. We can able to set the swiping to RowData only, this is our SfDataGrid behavior.  
 
Regards, 
Ashok 


Loader.
Up arrow icon