Animating grid cells

Hi,

I was wondering if there is a way to animate a cell in a sfDataGrid.  For example, if I can animate a grid cell flipping over to display another value when it's long-pressed?

I saw that the Syncfusion.SfDataGrid.XForms namespace has a GridCell class which derives from Xamarin.Forms.View.  If I can get access to the GridCell object at a particular location (row/column), I may be able to animate it.

Any thoughts?

Thanks,

Alfredo


3 Replies 1 reply marked as answer

KK Karthikraja Kalaimani Syncfusion Team June 10, 2020 10:43 AM UTC

Hi Alfredo,

We can get GridCell object on GridLongPressed event. Please refer to the below code snippet.

Code snippet,

 
…………..
this
.dataGrid.GridLongPressed += DataGrid_GridLongPressed;
………………
private void DataGrid_GridLongPressed(object sender, GridLongPressedEventArgs e) 
{ 
            var dataRow = this.dataGrid.GetRowGenerator().Items[e.RowColumnIndex.RowIndex]; 
            var WholeRowElement=  dataRow.GetType().GetRuntimeFields().FirstOrDefault(x => x.Name.Equals("WholeRowElement")).GetValue(dataRow); 
            GridCell gridCell =(GridCell)(WholeRowElement as VirtualizingCellsControl).Children[e.RowColumnIndex.ColumnIndex]; 
 } 
 
Regards,
Karthik Raja
 


Marked as answer

AL Alfredo June 10, 2020 06:43 PM UTC

That worked perfectly, thank you Karthik!


PK Pradeep Kumar Balakrishnan Syncfusion Team June 11, 2020 05:29 AM UTC

HI Alfredo, 
 
We are glad that the given solution meets your requirement.  
Please get in touch with us if you would require any further assistance. 
  
Regards, 
Pradeep Kumar Balakrishnan 
 


Loader.
Up arrow icon