In some situation, DataGrid record cannot be selected

21 views
Skip to first unread message

tong123123

unread,
Jan 3, 2013, 11:02:55 PM1/3/13
to google-we...@googlegroups.com
As shown in the attached datagridSelectedRecord.jpg, the selected record is yellow color and no onSelectionChange event is triggered when the situation is occured.
Normal selected record is shown as datagridSelectedRecord2.jpg, the selected record is blue color and onSelectionChange event is triggered.

the first strange case will be occured when user added a record in the datagrid, and then set the selectonmodel to point to that newly added record.
datagrid.setSelected(newItem, true);


I try to redraw() the datagrid after adding a item but it does not help.
datagridSelectedRecord.jpg
datagridSelectedRecord2.jpg

tong123123

unread,
Jan 4, 2013, 1:52:58 AM1/4/13
to google-we...@googlegroups.com
really strange, I find this behavior only occur when KeyboardSelectionPolicy.BOUND_TO_SELECTION is used, but why will this problem occur?
and under what circumstance will use expect keyboardSelection is not same as selectionmodel.setSelected?? (that is, when to use KeyboardSelectionPolicy.ENABLED)?
Reply all
Reply to author
Forward
0 new messages