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.
Unfortunately, activation email could not send to your email. Please try again.

swipedRowindex is wrong when there is grouping

Thread ID:

Created:

Updated:

Platform:

Replies:

131303 Jul 3,2017 06:35 PM Jul 5,2017 06:27 AM Xamarin.Forms 3
loading
Tags: SfDataGrid
Emil
Asked On July 3, 2017 06:35 PM

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

Ashok N [Syncfusion]
Replied On July 4, 2017 07:05 AM

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 


Emil
Replied On July 4, 2017 07:52 AM

Hi Ashok,

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


thanks,

Emil


Ashok N [Syncfusion]
Replied On July 5, 2017 06:27 AM

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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;