This is a migrated thread and some comments may be shown as answers.

Alterning style rows

4 Answers 333 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Daniel Botero Correa
Top achievements
Rank 1
Daniel Botero Correa asked on 12 Nov 2009, 03:55 PM
Hi everybody,

i want to change the row's color when (RowNumber Mod 2 == 0) in Design time but
it doesnt work...

i print on each row the RowNumber in a textbox and it always prints RowNumber = 1...
So, anyone have an idea?

i saw this example but that doesnt work...

http://www.telerik.com/support/kb/reporting/customization-tip/displaying-data-with-alternating-style-rows.aspx

I want to do it in design time...

Thanks....
Daniel BOTERO CORREA

4 Answers, 1 is accepted

Sort by
0
Daniel Botero Correa
Top achievements
Rank 1
answered on 13 Nov 2009, 09:32 AM
Hi,

I've seen differents examples where i can alternate style rows in telerik reporting
but none of them work right in the last version's telerik reporting.

i did the follow and that not work:

  1. Select the detail section of your report.
  2. Select the ConditionalFormatting property of the detail section.
  3. Click the New Rule button.
  4. Enter the expression "= RowNumber()%2"
  5. Select the equal "=" operator from the drop down list.
  6. Enter the value as "=1".
  7. Click the Style button.
  8. Click the Background style item.
  9. Enter the color as "#F0F0F0".
  10. Click OK to close each of the open dialogs.

In another forum, i got another example but it neither works, i want to do it in Design time...

Design Time

Open the report in designer and select the detail section. Right click and select "Conditional Formatting" from the context menu. Once the Conditional Formatting Rules editor appears, select the built-in RowCount() function for the expression and divide it by 2 (= RowNumber() % 2) , = as Operator and =0 for the Value column. Then from the Style button you can select the styles you would like to be applied to the detail section. When the above rule is evaluated it would apply your preferences to all even rows. You can see this in action in our List Bound Report online example.

In this example, the built in RowCount(), i've never found it...

I saw the online video but they don't show how to do it....

Somebody has ideas?

Thanks....
Daniel Botero Correa








0
Steve
Telerik team
answered on 13 Nov 2009, 10:01 AM
Hi Daniel,

Our List Bound Report demo report uses a List report item, and the Conditional formatting has been set on the second row (see attached screenshot). The online demo List Bound report is using the latest version and as you can see it works just as expected.
Please review carefully the KB article and List Bound Report that you have installed on your local machine to understand how it works.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Daniel Botero Correa
Top achievements
Rank 1
answered on 13 Nov 2009, 10:29 AM
Hi,

Yes, i installed the last version in my local machine and i understood immediately why my project doesn't work, i was going to write my solution...

It didn't work because i had generated a report automatically and my rows were always in the detail section, i should
have to create one list component and to add the elements.... after that i put the expression (= RowNumber()%2) and it has worked very good.

before i put the expression (= RowNumber()%2)  but in the detail section so, it will not work, because detail section is not repeated....

Thanks....
Daniel Botero Correa
0
Daniel Botero Correa
Top achievements
Rank 1
answered on 13 Nov 2009, 02:33 PM
Hello,

In the detail section it works in the telerik's examples but not in the reports generated with the wizard, that's strange..., anyway, in a short i have a success with telerik's examples....

Thanks,
Daniel Botero Correa
Tags
General Discussions
Asked by
Daniel Botero Correa
Top achievements
Rank 1
Answers by
Daniel Botero Correa
Top achievements
Rank 1
Steve
Telerik team
Share this question
or