Create row backcolor animation is possible?

Hello,

I have an SfDataGrid with datasource type: ObservableCollection<Model>

When I change a Model property in ObservableCollection the grid refresh itself automatically.

In this case I would like show an animation in the affected row in grid to user can easily see where the change was made (in which row).

For simplify my question:

When I have a Button, I can show a row backcolor-animation (flutter) in grid when I click on button?

I read this similar post, but it is for iOS projects:

https://www.syncfusion.com/kb/6335/how-to-apply-animation-for-the-selected-rows-in-sfdatagrid

Thank you!

BR, SZL


6 Replies 1 reply marked as answer

DM Dhanasekar Mohanraj Syncfusion Team September 5, 2022 03:43 PM UTC

Hi SZL,

Currently, we are checking the feasibility to achieve your requirement. We will check and update you with further details on September 07, 2022.

We appreciate your patience until then.

Regards,

Dhanasekar M.



DM Dhanasekar Mohanraj Syncfusion Team September 7, 2022 01:38 PM UTC

Hi SZL,


We have checked the feasibility to achieve your requirement. In your previous update, you mentioned the example with Xamarin.iOS. By default, other platforms like WPF have the additional facilities to achieve this like triggers, templates, etc. However, You can achieve your requirement with the help of a timer and background worker in WinForms SfDataGrid. Here we have attached our demo sample based on your scenario. Please have a look at this, and revert us if you have any concerns on this.

Regards,
Dhanasekar M.


If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Attachment: SfDataGrid_Demo_a5af08a9.zip


SZ SZL replied to Dhanasekar Mohanraj September 9, 2022 10:21 AM UTC

Hi,


Thank you for the example. Can you give me please some more details about the example, because I not find any row backcolor animation related code in this project. Updating cell values from observablecollection works fine for me too.

Thank you!


BR, SZL



DM Dhanasekar Mohanraj Syncfusion Team September 12, 2022 05:14 PM UTC

Hi SZL,


Sorry for the inconvenience caused,

In our previous update, we shared the demo which consists of when the underlying data get changed you can see the changes in UI with the help of a timer and background worker. You can achieve your requirement to change the background color for the modified row by using below code snippet,

private void SfDataGrid1_CurrentCellEndEdit(object sender, Syncfusion.WinForms.DataGrid.Events.CurrentCellEndEditEventArgs e)

{

    var record = (e.DataRow.RowData as OrderInfo);

    if (!ChangedRecordList.ContainsKey(e.DataRow.RowIndex))

        ChangedRecordList.Add(e.DataRow.RowIndex, record);

    else

    {

        ChangedRecordList[e.DataRow.RowIndex] = record;

    }

}

 

Dictionary<int, OrderInfo> ChangedRecordList = new Dictionary<int, OrderInfo>();

 

private void SfDataGrid1_QueryRowStyle(object sender, Syncfusion.WinForms.DataGrid.Events.QueryRowStyleEventArgs e)

{

    if (ChangedRecordList != null && ChangedRecordList.ContainsKey(e.RowIndex))

        e.Style.BackColor = Color.Aqua;

}


We have prepared the sample based on your scenario. Please find the sample in the attachment and let us know if you have any concerns about this.


Regards,

Dhanasekar M.


If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Attachment: SfDatagridDemo_9451f265.zip

Marked as answer

SZ SZL replied to Dhanasekar Mohanraj September 15, 2022 07:11 PM UTC

Its very good, thank you!



DM Dhanasekar Mohanraj Syncfusion Team September 16, 2022 02:00 PM UTC

Hi SZL,

If you are satisfied with our response, please mark it as an answer. Otherwise, please let us know if you have any further queries on this. We are happy to help you.

Regards,
Dhanasekar M.



Loader.
Up arrow icon