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
close icon

Modifying Rows in a SfDataGrid with Grouping

I'm utilizing the grouping capabilities of the SfDataGrid and I'm running into an issue where when I edit something in a group, that modified row gets pushed to the last row of the group.

You can see how this is a problem because the user loses their place.

For example, if my grid has a group called "Orders" with 50 rows in it, if I modify a record at row index 7, that row gets pushed down to row index 50.

I want to avoid this.  Any way to do this?

5 Replies

AR Akila Rajaram Syncfusion Team July 14, 2015 02:19 AM UTC

Hi Ari ,

Thank you for using Syncfusion Products .

We analyzed your query . By default , the edited value will be  rearranged to sorted order if we set the LiveDataUpdateMode as AllowDataShapping when Grouping is applied. This is the default behavior and we regret to  inform  you that we are unable to reproduce the reported problem “Modified row gets pushed to the last row of the group“ . We have prepared a sample  based on your requirement . Please find the attached sample from the following location ,

Sample : http://www.syncfusion.com/downloads/support/forum/119586/ze/SfDataGrid_Demo_119586-1011077315

Please have a look at the sample and if the issue still exists, could you please try reproducing it in the above sample or send reproducible sample along with the reproducing steps so that we could sort out the cause of the issue and provide you a better solution?

Please let us know if you require further assistance on this .

Regards,
Akila R .


AC Ari Case July 17, 2015 02:35 PM UTC

Your example works but the main difference is that you're binding to your grid with hard coded values.

I'm binding to mine using a DataView, maybe there's something with the way I'm binding that's causing this, it's been a problem for awhile now and I really need it resolved.

I'm binding like this:

DataView dataView = new DataView(myTable.Employees)
sfDataGrid.ItemSource = dataView.ToTable();

I'm also using 2 GridComboBox columns which I had to create a Control Template and Style for in the XAML to get it to display properly, I don't know if this helps narrow down what the issue is.

Also, is there a way I can securely send you guys an example of my code so you can take a look?


AR Akila Rajaram Syncfusion Team July 20, 2015 05:30 PM UTC

Hi Ari ,
 
Thanks for the update .
 
We analyzed your query “Need to  avoid modifying Rows in a  DataTable collection with Grouping  case “. We regret  to inform you that your requirement is not achieved with DataTable collection . Because DataTable behave differently in this case. By default , the data will be reordered based on the sorted order  if the underlying collection type is  DataTable . This is the default behavior of DataTable collection type .
 
Please let us know if you require  further assistance on this .
 
Regards ,
Akila R.



AC Ari Case July 20, 2015 08:15 PM UTC

Hi,

I think you responded to my thread with someone else's issue.


AR Akila Rajaram Syncfusion Team July 22, 2015 02:36 AM UTC

Hi Ari ,

Please ignore our previous update  and please find the below responses for your query .

Query 1 :  Binding using DataView

We analyzed your query . We have checked the reported problem “Modified row gets pushed to the last row of the group “  with the DataView  . We regret to inform you that we are unable to reproduce the reported problem in grouping case.

We have prepared the sample based on code snippet provided in your last update. Please find the sample from the following location ,

Sample : http://www.syncfusion.com/downloads/support/forum/119586/ze/SfDataGridSample-1712716125

Please refer the below video  for your reference ,

Video : http://www.syncfusion.com/downloads/support/forum/119586/ze/Video1460915304


Could you please confirm whether you have defined LiveDataUpdateMode as AllowDataShapping in your application .

Query 2 : I'm also using 2 GridComboBox columns which I had to create a Control Template and Style for in the XAML to get it to display properly, I don't know if this helps narrow down what the issue is.

We are not able to understand this query clearly and we need more information on this. Could you please confirm whether you have faced any UI related problem with GridComboBoxColumn and it could be resolved by customized style which is   display properly in GridComboBoxColumn . Also please let us know whether you have mentioned  the issue  which  related to the above data reordering problem or did you faced any other issue with GridComboBoxColumn . This would be helpful to  analyze further on this.

Query 3 : Also, is there a way I can securely send you guys an example of my code so you can take a look?

You can send the sample through this forum thread and it is possible to send the sample securely by  creating new incident . Could you please confirm whether you need to create new incident for this .

Please let us know if you require further assistance on this .

Regards,
Akila R.

Loader.
Live Chat Icon For mobile
Up arrow icon