.net - Infragistics context menu not closing -
in application use infragistics controls. works perfectly, context menu not closing if clicked anywhere else. example: 1) right click on item 2) click somewhere outside context menu 3) context menu should close, stays open, until click item inside it.
any ideas why happening?
some code, how contextual menu created , added grid.
dim contextualmenu popupmenutool = new popupmenutool(key) contextualmenu.dropdownarrowstyle = infragistics.win.ultrawintoolbars.dropdownarrowstyle.segmentedstatebutton addhandler contextualmenu.beforetooldropdown, addressof me.contextualmenu_beforetooldropdown dim deleteitem buttontool = new buttontool("delete") deleteitem.sharedprops.appearancessmall.appearance.image = imagesresources.delete deleteitem.sharedprops.caption = captions.delete addhandler deleteitem.toolclick, addressof me.deleteclick dim closeitem buttontool = new buttontool("close") closeitem.sharedprops.appearancessmall.appearance.image = imagesresources.close closeitem.sharedprops.caption = captions.close addhandler closeitem.toolclick, addressof me.closeclick me.basetoolbarsmanager.tools.add(contextualmenu) me.basetoolbarsmanager.tools.add(closeitem) me.basetoolbarsmanager.tools.add(deleteitem) contextualmenu.tools.addtool(deleteitem.key) contextualmenu.tools.addtool(closeitem.key) me.setcontextualmenu(me.grid, key)
as per comment above, give function call try after visible , invisible call:
private sub mydoevents() dim currmsg msg 'the following loop extract messages queue , dispatch them 'to appropriate window. while peekmessage(currmsg, 0, 0, 0, pm_remove) <> 0 translatemessage currmsg dispatchmessage currmsg loop end sub
this make sure code gets executed within cell click event.
Comments
Post a Comment