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

Changing Cell Color/Style

Hi,

Is there a way to customize the style of specific cell or whole column?  For example change the background color, put a border...

Thanks

9 Replies

PS Pavithra  Sivakumar Syncfusion Team May 24, 2017 12:59 PM UTC

Hi Hooman, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query. Your requirement can be achieved by using CustomGridCell derived from GridCell.  
 
Please refer the below KB link for further details. 
 
 
In this KB ,we have set the foreground color for the cell, instead of that, you can use background color property.  
 
Regards, 
Pavithra S 



HY Hooman Yazdi May 24, 2017 02:48 PM UTC

Thanks For Providing the sample.  The column that I am trying to change is the Editable column (GridNumericColumn).  Once I implement this and tap the column, App crashes.

Do you have any sample that shows how to customize the look of an editable column?


PS Pavithra  Sivakumar Syncfusion Team May 26, 2017 03:51 AM UTC

Hi Hooman, 
 
Thanks for your update. 
 
We have understand your query. The reported “tap on crash” issue is not replicated from our side. However, your requirement of applying style for editing column can be achieved by customizing the GridNumericColumnRenderer. 
 
We have prepared a sample based on it which can be downloaded from the below link. 
 
 
Please let us know, if you have any other query. 
 
Regards, 
Pavithra S 



HY Hooman Yazdi May 26, 2017 05:00 PM UTC

Thanks for your answer but we cannot find GridNumericColumnRenderer

Also the sample that you provided is in Xamarin.Forms.  We are trying to achieve this in Xamarin.iOS
Do you have any sample in Xamarin.iOS?

Thanks


PS Pavithra  Sivakumar Syncfusion Team May 29, 2017 11:13 AM UTC

Hi Hooman, 
 
Sorry for the inconvenience. 
 
The reported “tap on crash” issue is not replicated from our side. However, your requirement of applying style for editing column can be achieved by customizing the GridCellNumericRenderer 
  
We have prepared a sample based on it which can be downloaded from the below link.  
  
  
Please let us know, if you have any other query.  
  
Regards,  
Pavithra S  
 



HY Hooman Yazdi May 29, 2017 06:02 PM UTC

Thanks for Your Reply.  What I am trying to achieve is not customizing the cell while editing.  I am looking to be able to edit the customized cell.

To explain it better, I have attached the sample. As soon as tapping the editable cell, app crashes with the following message:

  at Syncfusion.SfDataGrid.GridCell.HandleTapGesture (UIKit.UITapGestureRecognizer Gesture) [0x00028] in <3680b4a196e04dda8d88dda86ec712c6>:0 

  at Syncfusion.SfDataGrid.GridCell.<SetupGestures>b__22_0 () [0x00000] in <3680b4a196e04dda8d88dda86ec712c6>:0 

  at UIKit.UIGestureRecognizer+ParameterlessDispatch.Activated () [0x00000] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIGestureRecognizer.cs:71 

--- End of stack trace from previous location where exception was thrown ---

  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)

  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIApplication.cs:79 

  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIApplication.cs:63 

  at RTProPhone.Application.Main (System.String[] args) [0x00001] in /Users/hooman/Projects/RentalTracker/RTProSLPhone/trunk/RTProPhone/Main.cs:35 




Attachment: VCTest_e90edce2.zip


PS Pavithra  Sivakumar Syncfusion Team May 31, 2017 04:25 PM UTC

Hi Hooman, 
  
Thanks for the update, 
  
We have checked your query. We don’t have support to edit the customized cell. We enable the editing by taking the first child of the given ColumnIndex and RowIndex. So, editing for customized cell is not possible since we do not know what the first child of the customized view is. 
  
Please let us know, if you have any other query. 
  
Regards, 
Pavithra S 



HY Hooman Yazdi May 31, 2017 09:52 PM UTC

Thanks for looking into this and clarification!

Is there any way of making the entire editable column background to a different color? or is it possible to change the background color of column header for editable column?

Thanks


PS Pavithra  Sivakumar Syncfusion Team June 6, 2017 05:55 PM UTC

Hi Hooman, 
 
We have checked your query. Your requirement can be achieved by customizing the GridCellNumericRenderer. We have prepared a sample based on it which can be downloaded from the below link. 
 
 
Regards, 
Pavithra S 


Loader.
Live Chat Icon For mobile
Up arrow icon