(I’m a Chinese , My English is poor , and this is my first time to ask a question , if i made some mistake , please tell me and I will correct it next time 
I want to use the python to connect to sql server 2008 , and do selecting . I’ll use the data to fill the grid.
after that , I want to edit the data in the grid and then update , or delete a row.
Should I manually create two buttons (‘update’ ‘delete’ ) in every end of a row or there are some easier and more beautiful way to do this?
For the “Delete” function, you usually need to have a button or icon
in each row. I have not seen a better way to do that.
There are several ways to do the “Update” function. If you intend
to have the grid be read-only most of the time, then you can
certainly have an “Update” button that allows the row to be
editable. However, think about Microsoft Access. As soon as you
click in a cell, you can type in that cell. You can continue to
change other cells in that row. As soon as you move to another row,
the changes are automatically saved. No button is required.
Only you can decide which style will make sense for your users.
···
wrote:
bbsmartly@gmail.com
I want to use the python
to connect to sql server
2008 , and do selecting . I’ll use the data to
fill the grid.
after that , I want to
edit the data in the
grid and then update , or delete a row.
Should I manually create
two buttons (‘update’ ‘delete’ ) in
every end of a row or
there are some easier and more
beautiful way to do this?
-- Tim Roberts, Providenza & Boekelheide, Inc.
timr@probo.com
Hi Tim
I no longer use wxPython, but I continue to monitor this group because a) I love the community spirit here, and b) the topic of user-interface design is really important to me, and I get good ideas from following some of the conversations.
This is how I handle the above requirement. Each 'grid' has a toolbar, which includes 'go to top', 'page up', page down', and 'go to end' buttons, together with an 'insert' button and a 'delete' button. The latter two have keyboard shortcuts of Ctrl+Insert and Ctrl+Delete. If a row is active, either by clicking on a cell or moving to it with an arrow key, you can invoke Insert or Delete on that row either by pressing the hotkey or by clicking the toolbar button.
Attached is a screenshot.
Do you see a problem with this approach?
Frank Millman
···
----- Original Message ----- From: "Tim Roberts" <timr@probo.com>
To: <wxpython-users@googlegroups.com>
Sent: Wednesday, May 27, 2015 8:29 PM
Subject: Re: [wxPython-users] How to add buttons in every row of a grid?
bbsmartly@gmail.com wrote:
I want to use the python to connect to sql server 2008 , and
do selecting . I'll use the data to fill the grid.
after that , I want to edit the data in the grid and then update , or
delete a row.
Should I manually create two buttons ('update' 'delete' ) in every
end of a row or there are some easier and more beautiful way to do this?
For the "Delete" function, you usually need to have a button or icon in
each row. I have not seen a better way to do that.
Frank Millman wrote:
This is how I handle the above requirement. Each 'grid' has a toolbar, which
includes 'go to top', 'page up', page down', and 'go to end' buttons,
together with an 'insert' button and a 'delete' button. The latter two have
keyboard shortcuts of Ctrl+Insert and Ctrl+Delete. If a row is active,
either by clicking on a cell or moving to it with an arrow key, you can
invoke Insert or Delete on that row either by pressing the hotkey or by
clicking the toolbar button.
...
Do you see a problem with this approach?
No, that's workable. It separates the "action" button rather far from
the thing being acted on, but that's a minor concern.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.