Right way to traverse cells and apply styles ? [message #1153274] |
Thu, 24 October 2013 13:51 |
SD Khan Messages: 63 Registered: May 2013 |
Member |
|
|
Hi Dirk !
Actually i am applying styles on the base of data, like mark cell red if it contains value "0" (zero). I have applied labels already and for applying styles i used the following way to do it
getDataLayer().setConfigLabelAccumulator(new IConfigLabelAccumulator()
{
@Override
public void accumulateConfigLabels(LabelStack labels,int columnPos,int rowPos)
{
int rowIndex = dsTable.getRowIndexByPosition(rowPosition);
int columnIndex = dsTable.getColumnIndexByPosition(columnPosition);
Object value = getDataValue(int rowIndex, int columnIndex)
if(columnIndex == 0)
{
if(value.toString().contains("0"))
{
setCellStyleAtPosition(rowPosition,columnPosition,colStyle);
}
}
});
}
The styles get applied successfully but i think this is not the right way , as the above way is used when some one has to accumulate labels. while i am only traversing the cells, Is this way is fine to do the job? or Is there any other way through which i can traverse all the cells , whenever the labels are accumulated or updated ?
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03485 seconds