Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
395
selecting a grid row programatically
posted

Hi,

       My grid uses "columnSelectRow" feature to allow selection of rows.

How can I set a row in grid as selected when an input column in the row is edited ?

 

Regards

 

Parents
No Data
Reply
  • 1579
    posted

    Hi,

    I would suggest that you use the following code in your selection change listener method:

    public void onChangeSelection(SelectedRowsChangeEvent e) {

    ...

     grid = (HtmlGridView) e.getComponent();

    grid.dataBind();

    Iterator rowsOnPage = grid.getRows().iterator();

    while (rowsOnPage.hasNext()) {

    RowItem item = (RowItem) rowsOnPage.next();

    if (... some condition ...) {

    item.setSelected(true);

    }

    }

    ...

    }

    I hope this will work. 

    Regards!

Children