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.

Modifying Rows in a SfDataGrid with Grouping

Thread ID:

Created:

Updated:

Platform:

Replies:

119586 Jul 10,2015 09:12 AM Jul 21,2015 10:36 PM WPF 5
loading
Tags: SfDataGrid
Ari Case
Asked On July 10, 2015 09:12 AM

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?

Akila Rajaram [Syncfusion]
Replied On July 13, 2015 10:19 PM

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 .

Ari Case
Replied On July 17, 2015 10:35 AM

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?

Akila Rajaram [Syncfusion]
Replied On July 20, 2015 01:30 PM

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.


Ari Case
Replied On July 20, 2015 04:15 PM

Hi,

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

Akila Rajaram [Syncfusion]
Replied On July 21, 2015 10:36 PM

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.

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.

;