Groups | Blog | Home
all groups > asp.net datagrid control > october 2003 >

asp.net datagrid control : Header Controls


Josh Behl
10/29/2003 8:50:24 AM
If you go to www.datagridgirl.com you'll find a control there that she
developed. It is pretty good.


[quoted text, click to view]

JemPower
10/29/2003 9:20:29 AM
Hi All,

Can someone help me with what I believe could be a simple answer. I've
created a datagrid, of which I have a template column containing checkboxes.

What I want to achieve is a checkbox in the header, so that when clicked,
checks all the checkboxes in the grid. I'm having a lot of difficulty even
placing the checkbox in the header!

Has anyone got an example of how I can do this please?

Many thanks,


JemPower
10/30/2003 9:28:27 AM
Many thanks for the help, now sorted. Quite easy I guess when you think
about it


[quoted text, click to view]

Cathie
10/30/2003 6:24:08 PM
I had a similar problem and found it was easier using a image button,
swapping the image between checked and unchecked when clicked. This way you
can use "ItemCommand" to handle the event and if you place say "SelectAll"
in the header image button (check box) command name then it should be easy
to find. In your handler all you have to do is check for e.CommandName ==
"SelectAll" and cycle through your check boxes checking/unchecking as
required.

Cathie

[quoted text, click to view]

AddThis Social Bookmark Button