c# - Datagridview: how to commit checkbox and and immediately filter by it? -


i have datagridview datagridview1, bound datatable1bindingsource, writable cell being checkbox bound boolean column "isselected". user checks checkbox, want show row checkbox checked. put following code:

private sub datagridview1_currentcelldirtystatechanged(sender object, e eventargs) handles datagridview1.currentcelldirtystatechanged     datagridview1.endedit()     datatable1bindingsource.filter = "isselected" end sub 

but not work - once ckeckbox checked, datagridview not show rows @ all.

if move statement datatable1bindingsource.filter = "isselected" separate command button,

private sub button1_click(sender object, e eventargs) handles button1.click     datatable1bindingsource.filter = "isselected" end sub 

then upon editing checkbox , clicking button, works expected, i.e. shows row.

why not work when it's issued immediately?

found reason. after

sender.endedit 

, before applying filter, have issue

datatable1bindingsource.endedit 

then works expected.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -