This is the way to remove an original CellMouseDoubleClick event handler to prevent to open records on double click in PivotalSearchResultsGrid.
Add CdcSoftware.Ios.dll reference to you Client Task project.
Add DisableSearchResultGridDoubleClick function call in your Client Task in OnFormInitialized handler:
public override void OnFormInitialized() { PivotalSearchResultsGrid clientDetectionSearchResultsGrid = this.FormControl.GetControlByName("ClientDetectionPivotalSearchResultsGrid") as PivotalSearchResultsGrid; if (clientDetectionSearchResultsGrid != null) { DisableSearchResultGridDoubleClick(clientDetectionSearchResultsGrid); } } private void DisableSearchResultGridDoubleClick(PivotalSearchResultsGrid grid) { if (grid != null) { FieldInfo eventHandlerInfo = grid.ResultsViewControl.GetType().GetField("CellMouseDoubleClick", BindingFlags.NonPublic | BindingFlags.Instance); object oHandler = eventHandlerInfo.GetValue(grid.ResultsViewControl); EventHandler<cdcsoftware.iaf.ios.messaging.iafmessageeventargs> eventHandler = oHandler as EventHandler<cdcsoftware.iaf.ios.messaging.iafmessageeventargs>; if (eventHandler != null) { grid.ResultsViewControl.CellMouseDoubleClick -= eventHandler; } } } }
No comments:
Post a Comment