Search code examples
eclipse-rcpnebula

Looping through rows in Nebula Grid


I have a Nebula Grid with rows of data in it.

How do I loop through each row to capture data from it?

Thank you.


Solution

  • I just came across this on my own endeavours to find an answer to my own question. Anyways, looping through a nebulagrids rows (or griditems, as they are called) can be accomplished like this:

    GridItem[] itemList = grid.getItems();
    for(GridItem item:itemList){
        System.out.println(item.getText());
    }
    

    Depending on the data you want to retrieve from an item you will have to replace item.getText() with something to your own liking.