Page 1 of 1

Alternate row style

Posted: Thu Sep 17, 2015 2:43 pm
by victorinable
Hi,

I've made a report whic uses a Cross-tab directly on page, as a Summary of a list. I would like to know how can I apply alternate design to each row. I mean, [row1-->white, row2-->blue, row3-->white, row4-->blue...].

Thanks for any hint.

Re: Alternate row style

Posted: Fri Sep 18, 2015 8:40 am
by HighAley
Hello.

You could use conditions to highlight the necessary row. But it's possible to check values of Columns and Rows like in next expression:

Code: Select all

(sender as StiCrossSummary).CrossColumnValue == "4"
(sender as StiCrossSummary).CrossRowValue == "ANTON"
You could add as many Conditions as you need.

Thank you.

Re: Alternate row style

Posted: Fri Sep 18, 2015 2:25 pm
by victorinable
Hi Aleksey,

Thanks for the reply, it seems it's alm,ost what I want. Can I do something like:

Code: Select all


i=(sender as StiCrossSummary).LineNumber

if(i %2==0) {
(sender as StiCrossSummary).row(i).color = #b0b0b0 
}else{
(sender as StiCrossSummary).row(i).color = #000000)
}



Thanks in advance

Re: Alternate row style

Posted: Mon Sep 21, 2015 1:34 pm
by HighAley
Hello, Victor.

If you just need to change background of odd and even lines of the Cross-tab, you can to set the background of the Summary to one color and change it in ProcessCell event. Here is a sample code:

Code: Select all

if (e.Row % 2 == 0)
{
    (sender as StiCrossSummary).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Red);
};
Thank you.