Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Facing issue while rename column header in Nattable(RenameColumnHeaderCommand doesn't work properly for the columns which are not visible.)
Facing issue while rename column header in Nattable [message #1746896] Mon, 07 November 2016 12:45 Go to next message
soma dey is currently offline soma deyFriend
Messages: 1
Registered: April 2016
Junior Member
My nattable consist of 27 columns, i want to rename the few columns based on columnposition using RenameColumnHeaderCommand, but it doesnt work .
For ex.
when nattable is loaded it shows first 9 columns and when i use the command to rename the columnposition 18 , then it doesnt work.
when i try to get data at this position it throws me index out of bound exception.
Re: Facing issue while rename column header in Nattable [message #1747046 is a reply to message #1746896] Tue, 08 November 2016 20:23 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2623
Registered: July 2012
Senior Member
I don't know what you are doing in detail, but probably this is because the position is not visible from the NatTables point of view. This is because of the ViewportLayer. I never tried to call the RenameColumnHeaderCommand programmatically, but I guess it doesn't support renaming not visible columns by position.
Re: Facing issue while rename column header in Nattable [message #1747064 is a reply to message #1747046] Wed, 09 November 2016 08:00 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2623
Registered: July 2012
Senior Member
By the way, do you really only want to rename the header visually or in the data model. The RenameColumnHeaderCommand triggers some action to make it possible for a user to set another column name while the real value in the data model stays unchanged. I suppose you really want to change the data value of the column header which you could achieve by calling an UpdateDataCommand or simply setDataValue() on the column header data provider.
Re: Facing issue while rename column header in Nattable [message #1747115 is a reply to message #1746896] Wed, 09 November 2016 15:51 Go to previous message
Naveen Sabapathy is currently offline Naveen SabapathyFriend
Messages: 46
Registered: July 2016
Member
One more way to solve this problem would be.

Instead of using
 columnHeaderLayer.renameColumnPosition(columnIndex, NewName); 

you can use
 columnHeaderLayer.renameColumnIndex(columnIndex, NewName); 


This might help you.
Previous Topic:Observation: Alternate row color changes in custom style
Next Topic:Groupby display name shows original name
Goto Forum:
  


Current Time: Tue Nov 13 23:00:58 GMT 2018

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

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

Back to the top