Editing and modifying values on the SfDataGrid
- Dog
- Cat
- Fox
- Lion
Thank you for using Syncfusion products.
We analyzed your query. You can achieve your requirement by setting LiveDataUpdateMode property as Default. Please refer the following code snippet and sample:
Code Snippet:
|
<syncfusion:SfDataGrid Name="sfDataGrid" AllowGrouping="True" AllowEditing="True" ShowGroupDropArea="True" AllowFiltering="True" AllowSorting="True" AutoExpandGroups="True" ItemsSource="{Binding OrderInfoCollection}" LiveDataUpdateMode="Default" |
Sample: ModifyValueOnSfGrid
Please let us know if this solution helps you.
Regards,
Muthukumar K
- If I'm on a specific record in the "Lion" group and I change the animal of that record to a "Cat", is there a way to prevent that record from being grouped to the "Cat" group right away? I'd want to hold off on automatically changing groups of changed animal values.
- The other alternative would be if I change the animal of that record from Lion to Cat,the cursor should move to that record in the new Cat group.
Thanks for the update.
Query 1: It seems as though after I updated my Syncfusion version, modifying data on the grouped grid no longer jumps to the first grouped column like before, so this worked without me setting LiveDataUpdateMode="Default".
In our source itself, we have set the LiveDataUpdateMode as Default, so there is no need to again set LiveDataUpdateMode as Default in SfDataGrid definition.
Query 2 -1: If I'm on a specific record in the "Lion" group and I change the animal of that record to a "Cat", is there a way to prevent that record from being grouped to the "Cat" group right away? I'd want to hold off on automatically changing groups of changed animal values.
If we set LiveDataUpdateMode as “AllowDataSharping” and modified the value of grouped records, the record will be moved to the corresponding group or it will create a new group. This is default behavior for SfDataGrid. If you want to prevent the record from moving to the group after edit, you can set LiveDataUpdateMode as Default. The record then would not get moved to another corresponding group to refresh the grid.
Query 2 -2: If I change the animal of that record from Lion to Cat,the cursor should move to that record in the new Cat group.
You can move the cursor to the changed group record position, by using the MoveCurrentCell() method. Please refer to the below code snippet and attached sample,
Code Snippet:
|
this.sfDataGrid.CurrentCellEndEdit += sfDataGrid_CurrentCellEndEdit; void sfDataGrid_CurrentCellEndEdit(object sender, CurrentCellEndEditEventArgs args) { this.Dispatcher.BeginInvoke(new Action(() => { this.sfDataGrid.MoveCurrentCell(new RowColumnIndex(args.RowColumnIndex.RowIndex, args.RowColumnIndex.ColumnIndex));
}), DispatcherPriority.ApplicationIdle); |
Sample: SfGrid_ModifyValue
Please let us know if you have any other questions.
Regards,
Muthukumar K
Thank you for your update.
We are glad to know that, your issue has been resolved. Please let us know if you need any further assistance in future regarding Syncfusion Products.
Thanks & Regards,
Muthukumar K
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 ,
Ashok
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,
Ashok
- 9 Replies
- 3 Participants
-
AC Ari Case
- Jun 30, 2015 01:27 PM UTC
- Jul 22, 2015 03:36 AM UTC