CheckBoxField in GridView Tasks - Edit Column can it be a CommandField too?

H

hazz

Given the update query
UPDATE Columns
SET Include_in_Report = @Include_in_Report
WHERE (ID = @Original_ID);

Include_In_Report is a bit field in the table, represented as a checkbox on
the grid.

If someone clicks on the checkbox, I would like the bit field in that row in
the database table to be updated immediately. I don't want to have to first
select the Edit button, which then selects the whole row in the grid as
editable.
I ONLY want that one column of the datarow to be editable, all the other are
readonly.

Include_In_Report should be a CommandField AND a CheckBoxField at the same
time. As a Commandfield it would fire the update query above.

How do I do that?

Thank you for any help.

Greg
 
G

Guest

You can use TemplateFields. Once all the fields are represented by template
fields you have complete control over what apears in each of the cells in
redonly and edit modes of a gridview. To convert fields to template fields,
edit the properties of the gridview using the smartag thingy and you will
notice that as you select each field there is an option at the botom that
says, convert to a template field. The just replace the textbox or whatever
controls in EditItemTemplate sections with label controls.
 
H

hazz

Thank you. I am learning about those now.

clickon said:
You can use TemplateFields. Once all the fields are represented by
template
fields you have complete control over what apears in each of the cells in
redonly and edit modes of a gridview. To convert fields to template
fields,
edit the properties of the gridview using the smartag thingy and you will
notice that as you select each field there is an option at the botom that
says, convert to a template field. The just replace the textbox or
whatever
controls in EditItemTemplate sections with label controls.
 

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

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,829
Latest member
KimberAlli

Latest Threads

Top