Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Column Group Header Rename
Column Group Header Rename [message #1736174] Mon, 27 June 2016 10:00 Go to next message
Bhagwan Moondra is currently offline Bhagwan MoondraFriend
Messages: 9
Registered: May 2015
Junior Member
Hello,

I need to rename a group column header dynamically after NatTable is created & loaded. There is RenameColumnHeaderCommand() which works only for column header but there is no similar command available for group column header.

DisplayColumnGroupRenameDialogCommand() pops up a dialog to rename a group column header but I need to do it program-wise and not leaving it to user.

One way is to label the group column inside getConfigLabelsByPosition() when the ColumnGroupHeaderLayer is getting created and then in config registry for that label, use a "display converter" to change the header name as desired. But I think that is not the brightest way to achieve this.

Is there any better solution to this?

Thanks
Re: Column Group Header Rename [message #1736178 is a reply to message #1736174] Mon, 27 June 2016 10:39 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2614
Registered: July 2012
Senior Member
The name of a column group is taken out of the ColumnGroup. The ColumnGroup can be taken out of the ColumnGroupModel. By knowing the ColumnGroupModel and the column index you can change the column group name programmatically with a snippet similar to this

ColumnGroupModel model = ...;
...
ColumnGroup columnGroup = this.model.getColumnGroupByIndex(columnIndex);
columnGroup.setName("new column group name");
Re: Column Group Header Rename [message #1736191 is a reply to message #1736178] Mon, 27 June 2016 12:14 Go to previous message
Bhagwan Moondra is currently offline Bhagwan MoondraFriend
Messages: 9
Registered: May 2015
Junior Member
Thanks a lot! This is much much better & easy way.
Previous Topic:Change localization of search mask
Next Topic:Select a row after including a new one
Goto Forum:
  


Current Time: Fri Sep 21 01:43:21 GMT 2018

Powered by FUDForum. Page generated in 0.04326 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top