DataGridView - checkbox row selection?

M

Mario

I have a question about the way Microsoft implements row selection in
the DataGridView. I have a spec in front of me for a Windows screen
that allows users to enter values into a form and to select multiple
rows from a grid. When the user clicks "Apply" the rows that were
selected are updated with the form values.

The thing is, my users want a "Select" checkbox column down the right
hand side of the grid. The user is supposed to click on the checkboxes
for the rows he wants to update. Also, there is a "Select All"
checkbox just over that column on the grid. From what I've seen on the
web and elsewhere this is a very common technique for selecting and
updating rows.

The DataGridView unfortunately does not allow for this kind of row
selection. Instead, users must hold the control key down and select
multiple rows. Instead of a checkbox being checked for selected rows,
the selected rows are highlighted. Unfortunately, this method of
selecting rows is less desirable to my users than the more common
technique I cited.

Trouble is, when I add a "Select" column to the underlying table, the
RowState is invalidated when a user checks a row. As far as that row
is concerned it has been updated. Without getting into the gory
details, I have to jump through a number of loops to allow my grid to
work with a checkbox column.

1. Do your apps do anything similar to what I've suggested, selecting
and updating multiple rows? If so, do you use the Microsoft way or a
checkbox?
2. What do you think about one way vs. the other? The checkbox way
seems more natural to me. Unfortunately, since it is not supported, it
is also more complicated.

A coworker suggested I create a separate table and join it by relation
to the table I'm updating. That table would have the same primary key
plus the new Select column. This seems like a potentially nicer way of
avoiding some of the hoops, but I'm open to hearing your thoughts on
the matter.

Thanks.
Mario T. Lanza
Clarity Information Architecture, Inc.
2006.05
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top