How to select row on click on row in tree datagrid

In tree datagrid, if we click on the hierarchy column, it will expend or collapse but row will not get selected. To select the row we have to click on blank space in column.

In my case, i have to show other data based on this selection and want to select the row along with collapse/expend of the hierarchy column. (because if the content length in column is more, there will not be any blank space in column and there no way to select it).

Please advice.

From the source code of TreeDataGrid
you can find addItemDoubleClickListener, or addItemClickListener
I hope it helps
:slight_smile:

‘’’
@ViewComponent
private TreeDataGrid treeDataGrid;

{
treeDataGrid.addItemDoubleClickListener((ComponentEventListener<ItemDoubleClickEvent>) geoTreeNodeEntityItemDoubleClickEvent → notifications.create(“GeoObjectClickEvent”, >(geoTreeNodeEntityItemDoubleClickEvent.getItem().getName() + " clicked"))
.withPosition(Notification.Position.BOTTOM_END)
.show());
}
‘’’

or

‘’’ @Subscribe(“treeDataGrid”)
protected void onItemDoubleClick(ItemDoubleClickEvent event) {
notifications.create("onItemDoubleClick Items: " + event.getItem().getName())
.withPosition(Notification.Position.BOTTOM_END)
.show();
}
‘’’

Thanks for advice.

Double click select the row but i want it on single click along with expending the node. Single click just expend/collapse the node.

How can I select node on single click. (SingleClickEvent doesnot help)