cancel
Showing results for 
Search instead for 
Did you mean: 

How can i set the alternating colors for a table rows

Former Member
0 Kudos

Dear All,

Please any one help me how can i set the Alternating colors for Table Rows.

i created a theam there i set the background alternating color to brown and i set the table design properity to alternating. but it is not reflecting.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

There is a work around for this if this is realy required.

Add one more value attribute to the node which is bound to the table.

the type is com.sap.ide.webdynpro.uielementdefinitions.TableCellDesign.

in the program while creating the node elements, fill this tablecelldesign like below

int j = 0;

for(int i=0;i<5;i++)

{

if(j == 0)

{

mm.setCelldes(WDTableCellDesign.CRITICALVALUE_DARK);

j=1;

}

else

{

j=0;

}

In the Layout, for al the coulmns , the Celldesign property has to be bound to the newly created attribute.

AM

Former Member
0 Kudos

Hello Mathew,

I have the same problem as the original poster, where I want alternating colors for a table that has editable cells.

Is your example for 6.40 or 7.0(Nw 04s)?

In 6.40 I can't find a property called Celldesign on the columns. Only "Design" which is of type CellBackroundDesign.

*edit

I found it in nw70. You have to use grouped column.

Edited by: Richard Linnander on Jul 28, 2009 3:20 PM

Former Member
0 Kudos

Hi,

Alternative design works at runtime only when table is in readony mode.

Regards,

Charan

Former Member
0 Kudos

Hi,

Set the readonly property of table to "true" and design property to "alternating".

This will give you the alternate colors in the table.

Try to set this two properties to your table and try..

Hope this helps you..

Regards,

Saleem

Former Member
0 Kudos

Hi,

if i set the read only property is true that is working fine. But in my senario the table is editble one.

i can't make that read only property is true. so please tell me there is any possibulities for alternating colors in editable Tables.

Thanks,

bhargava.

Former Member
0 Kudos

Hi,

Using design property there is no other possibility.

If your table is editable then you can't make it read only. So alternative does not work.

Regards,

Charan

Former Member
0 Kudos

Hi,

The design property in Table properties should work for your requirement. Select "alternating" value for design.

Please see the API below:

design

Determines the appearance of the table. The property design can take the following values and is represented by enumeration type WDTableDesign.

alternating - The table rows are displayed alternately in a different color.

standard - The table background has one color. The individual table rows are displayed with grid net lines.

transparent - The table background is transparent. The individual table rows are displayed without grid net lines.

Check whether you have changed the right property or not? Also table should contain more than one rows to test this scenario.

Regards,

Jaya.

Edited by: VJR on Jun 17, 2009 6:43 PM