def OnCellBackgroundColor ( self , event ) : with undo . group ( _ ( "Background color" ) ) : self . grid . actions . set_attr ( "bgcolor" , event . color ) self . grid . ForceRefresh ( ) self . grid . update_attribute_toolbar ( ) event . Skip ( )
python change background color in grid
Cell background color event handler
def OnCellBackgroundColor(self, event):
        """Cell background color event handler"""

        with undo.group(_("Background color")):
            self.grid.actions.set_attr("bgcolor", event.color)

        self.grid.ForceRefresh()

        self.grid.update_attribute_toolbar()

        event.Skip()