On 8/3/10 8:17 PM, Bronwyn Woods wrote: > Hi, > I have what I hope is a simple question. I have a dGrid with a column of > checkboxes with DataType "bool". I would like to call code when the user > checks or unchecks a check box, but I haven't been able to figure out how to > bind an event to a checkbox within a column of a grid. > > The code I have to create the grid and the column is > > > class selMovesGrid(dabo.ui.dGrid): > def afterInit(self): > self.addColumn(Name="incl", Caption="Includes", Width=60, > DataType="bool", Sortable=True, DataField = "incl", > Searchable=False, Editable=True, Resizable=False) > > class selMoves(dabo.ui.dPanel): > def afterInit(self): > [...] > self.selGrid = selMovesGrid(self) > [...] > > > > I'm not sure if I need to bind the event to the column or the instance of > the grid or what.
You are treading on an area that Dabo hasn't fully wrapped. Try: grid.bindEvent(dabo.dEvents.GridCellEditorHit, yourHitMethod) As it stands, this should only be called when a grid editor checkbox has been toggled, but I'm not sure if your event handler will be able to find out *which* checkbox has been toggled, without looking at the grid's current row and column. Paul _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
