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.

Changing Cell Color/Style

Thread ID:

Created:

Updated:

Platform:

Replies:

130653 May 23,2017 05:38 PM Jun 6,2017 01:55 PM Xamarin.iOS 9
loading
Tags: SfDataGrid
Hooman Yazdi
Asked On May 23, 2017 05:38 PM

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

Pavithra  Sivakumar [Syncfusion]
Replied On May 24, 2017 08:59 AM

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 


Hooman Yazdi
Replied On May 24, 2017 10:48 AM

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?

Pavithra  Sivakumar [Syncfusion]
Replied On May 25, 2017 11:51 PM

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 


Hooman Yazdi
Replied On May 26, 2017 01:00 PM

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

Pavithra  Sivakumar [Syncfusion]
Replied On May 29, 2017 07:13 AM

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  
 


Hooman Yazdi
Replied On May 29, 2017 02:02 PM

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

Pavithra  Sivakumar [Syncfusion]
Replied On May 31, 2017 12:25 PM

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 


Hooman Yazdi
Replied On May 31, 2017 05:52 PM

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

Pavithra  Sivakumar [Syncfusion]
Replied On June 6, 2017 01:55 PM

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 


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.

;