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

  • Thread starter Thread starter hazz
  • Start date Start date
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
 
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.
 
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.
 
Back
Top