Hi. I need some help with the Grid component.
Here is the code that I'm working with:
self.components.grdDataGrid.EnableEditing(False)
def on_grdDataGrid_mouseDoubleClick(self, event):
self.components.grdDataGrid.EnableEditing(True)
event.skip()
def on_grdDataGrid_selectCell(self, event):
self.components.grdDataGrid.EnableEditing(False)
event.skip()
def on_grdDataGrid_keyDown(self, event):
self.components.grdDataGrid.EnableEditing(False)
event.skip()
def on_grdDataGrid_editorShown(self, event):
result = dialog.messageDialog(self, "Are you sure you wish to edit this cell?","Edit", wx.YES_NO)
if not result.accepted:
event.Veto()
self.components.grdDataGrid.EnableEditing(False)
return
event.skip()
def on_grdDataGrid_editorHidden(self, event):
result = dialog.messageDialog(self, "Are you sure you wish to save the changes?","Save", wx.YES_NO)
if not result.accepted:
event.Veto()
return
event.skip()
I would like to allow editing only if the user double clicks in the cell. After editing a cell and using enter or tab to exit the cell, the dialog associated with the editorHidden event pops up twice. I only want it to pop up once. Any help would be appreciated. Thanks.
Jason
|