Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Row Spanning
Row Spanning [message #1817055] Thu, 14 November 2019 18:44 Go to next message
dhruba kumar is currently offline dhruba kumarFriend
Messages: 51
Registered: September 2012
Member
WE have a table with two columns ColA , ColB
Table has Five rows:
============================
Col A | ColB
============================
X | NA
-----------------------------------------
X | NA
-----------------------------------------
X | NA
-----------------------------------------
Y | NA
-----------------------------------------
Y | NA
-----------------------------------------
Z | NA
============================

Now we want , after rowspanning(Merging) the table should showlike this :
============================
Col A | ColB
============================
|
X | NA
|
-----------------------------------------
|
Y | NA
-----------------------------------------
Z | NA
============================

But it is Showing like below :

Below Code Used:

spanningDataProvider.addAutoSpanningColumnPositions(0);

spanningDataProvider.addAutoSpanningColumnPositions(1);

spanningDataProvider.addAutoSpanningRowPositions(0,1,2);
spanningDataProvider.addAutoSpanningRowPositions(3,4);


============================
Col A | ColB
============================
|
X |
|
----------------| NA
|
Y |
-----------------------------------------
Z | NA
============================




Re: Row Spanning [message #1817074 is a reply to message #1817055] Fri, 15 November 2019 07:01 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
From the API I assume you are using the AutomaticSpanningDataProvider which automatically spans cells based on their value. Actually if you read the javadoc of that class, you should notice that your use case is not supported out of the box, as you want the auto span in the first column, but additional logic in the second column that performs auto spanning based on the spanning in the first column.

That said, instead of using the AutomaticSpanningDataProvider you need to implement a custom ISpanningDataProvider that fullfills your requirements.
Re: Row Spanning [message #1817095 is a reply to message #1817074] Fri, 15 November 2019 13:32 Go to previous message
dhruba kumar is currently offline dhruba kumarFriend
Messages: 51
Registered: September 2012
Member
Thanks Dirk. Its Working.
Previous Topic:Generating PDF in NatTable
Next Topic:Unbind cell selection with selected row
Goto Forum:
  


Current Time: Sat Apr 27 04:54:41 GMT 2024

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

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

Back to the top