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.
Syncfusion Feedback

Problem with the RowStyleSelector

Thread ID:

Created:

Updated:

Platform:

Replies:

123716 Apr 13,2016 01:42 PM UTC Apr 22,2016 11:28 AM UTC WinRT 5
loading
Tags: SfDataGrid
Aurélien
Asked On April 13, 2016 01:42 PM UTC

Hello,

I have a problem with the RowStyleSelector.

I want to apply a particular style according to particular values in my SfDataGrid while maintaining an alternate row style.

When I use a SfDataGrid with DetailsViewDefinition option, in my CustomRowStyleSelector, the row indexes are 1,3,5,7 instead of 1,2,3,4,5.

I can’t use AlternatingRowStyle because this one overrides RowStyleSelector.

Currently, I’ve fixed the problem by using this formula: if ((row.RowIndex + 1) % 4 != 0).

I think it’s not a reliable solution. Do you have another/better solution?

Best regards,

Aurélien


Attachment: App9_d4a6b62f.zip

Jayapradha S [Syncfusion]
Replied On April 15, 2016 12:31 PM UTC

Hi Aurélien,

Thank you for contacting Syncfusion Support.


We have analyzed your query. The row index  is varied when using DetailsViewDefinition, as each row has DetailsViewDataRow hidden under it. So, you can overcome this problem by using AlternateRowStyleSelector along with RowStyleSelector. In the AlternateRowStyleSelector, you can provide first priority for custom style and second priority for alternate style.

We have modified your sample and please find the sample from the following location,
Sample Link:  http://www.syncfusion.com/downloads/support/forum/123716/ze/App91457681435

Regards,
Jayapradha


Aurélien
Replied On April 19, 2016 07:12 AM UTC

Hi Jayapradha,
I'll test it.
Thank you.


Ashwini Paranthaman [Syncfusion]
Replied On April 20, 2016 10:42 AM UTC

Hi Aurelien,
 
Thank you for the update.
 
We will wait to hear from you.
 
Regards,
 
Ashwini P.

Aurélien
Replied On April 21, 2016 06:47 AM UTC

Hi,
That works well !
Thank you.
Aurélien

Srinivasan Vasu [Syncfusion]
Replied On April 22, 2016 11:28 AM UTC

Hi Aurelien, 
  
Thank you for the update.  
 
Please let us know if you need further assistance. 
  
Regards, 
Srinivasan 


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.

Warning Icon 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.Close Icon

;