473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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

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
Apr 27 '06 #1
2 7200
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.

"hazz" wrote:
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

Apr 27 '06 #2
Thank you. I am learning about those now.

"clickon" <cl*****@discussions.microsoft.com> wrote in message
news:51**********************************@microsof t.com...
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.

"hazz" wrote:
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

Apr 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
3
by: Brad | last post by:
I am programatically trying to add a checkBox column to a gridView. This is what I have to do it (VB): Dim cbCol As New CheckBoxField cbCol.Text = "Enter this event" gvEvents.Columns.Add(cbCol)...
1
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. ...
13
by: AG | last post by:
I have a gridview that I bind to a List(of Type) at runtime. Not using a datasource control. The gridview has a template column with an imagebutton whose commandname is set to 'Delete'. The...
1
by: spitapps | last post by:
I have a gridview declaratively added to my webform. This gridview displays data from a stored procedure returned as a dataset. Once the dataset has been modified slightly i bind it to my...
1
by: savajx1 | last post by:
I need to dynamically create a set of bound fields contained in a GridView control. I also have a single static CommandField that I can declare in the Columns <tagof the GridView control. I have...
0
by: lamolap | last post by:
i have 1 gridview , a dropdownlist inside a gridview and a commandfield of (edit, update and cancel) my gidview looks like this Edit Surname Initials ...
2
by: DC | last post by:
Hi, I am using a GridView to present data in a DataTable, which I store only in ViewState and when the user hits the "OK" button the rows in the DataTable will be used to execute transactions. ...
1
by: J | last post by:
I like the Edit (Update, Cancel) functionality built into the gridview, but I'd like to control what happens when the Update is clicked. I would like to prompt the user with something like this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.