On Oct 27, 2006, at 4:15 AM, Basil Shubin wrote:
Sad but my question stay unanswered :-( I'm still need yours help!
Sorry, I saw that but wanted to let Paul continue, since he wrote
the original response.
1. Set event handler for left single click on row (wich event I
must catch, and how correctly handle it)?
This only works when the grid cells are not editable: bind to the
GridMouseLeftClick event. You can also bind to the GridMouseLeftUp
event; this will be raised when the user releases the mouse button,
whether or not they moved the mouse since the GridMouseLeftDown fired.
When the cells are editable, GridCellEditBegin will be raised when a
cell's editor becomes active.
1.2. And how to catch left double click?
Bind to GridMouseLeftDoubleClick.
2. From previous event handler get a selected item in DataSet?
Use the grid's CurrentRow and CurrentColumn. If you allow
MultipleSelection, you can check the grid's Selection property to
determine the selected range.
3. Delete selected row and item in DataSet?
DataSets are basically Python tuples, so you work with them like you
would with tuples. For example, if you want to remove the third row:
ds = grid.DataSet
newlist = list(ds).pop(2)
newDS = tuple(newlist)
grid.DataSet = newDS
4. Insert a new row and item in DataSet?
Same thing, except you need to create the dict that will be the new
row, making sure that the keys match the keys for your grid columns.
4.1. Is there built-in function to make row and item duplicate?
No.
5. Should I manually (and how to) update dGrid subclass after
updating the DataSet outside the class?
Just set the DataSet property to the new data set.
5.1. How to make correct grid with an empty DataSet?
Just set the DataSet property to an empty tuple.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users