BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

select cell from jdbTable

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder DB Swing
View previous topic :: View next topic  
Author Message
apostolis
Guest





PostPosted: Fri Oct 13, 2006 3:20 pm    Post subject: select cell from jdbTable Reply with quote



Hi,
I am using a jdbTable which shows data from a database(queryDataset). l
need to have some fields (one for each row but not in the same column)
where
they will not be editable for the user, and with different color from the
other fields of the Table.

Thanks
Apostolis
Back to top
Kevin Dean [TeamB]
Guest





PostPosted: Fri Oct 13, 2006 10:13 pm    Post subject: Re: select cell from jdbTable Reply with quote



apostolis wrote:

Quote:
Hi,
I am using a jdbTable which shows data from a database(queryDataset). l
need to have some fields (one for each row but not in the same column)
where
they will not be editable for the user, and with different color from the
other fields of the Table.

You can colour cells using code similar to the code below. As for making
individual columns read-only on a row-by-row basis, you would have to add
a NavigationListener to the data set and change the "readOnly" property of
each column every time a new row is selected.

private ColumnPaintListener columnPaintListener = new ColumnPaintAdapter() {
public void painting(DataSet dataSet, Column column, int row, Variant value, CustomPaintSite paintSite) {
if (paintSite instanceof TableFastStringRenderer) {
Variant allocated = new Variant();
dataSet.getDisplayVariant(allocatedColumnOrdinal, row, allocated);

paintSite.setBackground(allocated.getAsBoolean() ? Color.WHITE : Color.YELLOW);
}
}
};

allocatedColumnOrdinal = eventsDataSet.getColumn("allocated").getOrdinal();
try {
for (int index = 0; index < eventsDataSet.getColumnCount(); index++) {
eventsDataSet.getColumn(index).addColumnPaintListener(columnPaintListener);
}
}
catch (TooManyListenersException ex) {
// Ignore exception.
}



--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder DB Swing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.