473,394 Members | 1,759 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,394 software developers and data experts.

A gridview event/method to capture all checkbox.check states in this BoundColumn and Item_Bound grid?

The following code generates checkbox values from the database. Once the
user selects/deselects checkbox values, is there a way to obtain the ID and
Checkbox.Checked state from these BoundColumns so I can update the table
they came from? Thank you. -Greg

<asp:DataGrid id="ItemsGrid" runat="server"
OnItemDataBound="Item_Bound" AutoGenerateColumns="False"
AllowSorting="True">
<Columns>
<asp:BoundColumn HeaderText="ID"
ReadOnly="True"
DataField="ID"/>
<asp:BoundColumn HeaderText="Column_Name"
ReadOnly="True"
DataField="ColumnName"/>

<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1"
Text=""
runat="server"/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>

void Item_Bound(Object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item)
{
CheckBox check = (CheckBox)e.Item.FindControl("CheckBox1");
if (check != null)
{
check.Checked =
Convert.ToBoolean(((SSI.ColumnsForReport)(e.Item.D ataItem)).Include_in_Report);
}
}
May 3 '06 #1
0 1473

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

Similar topics

2
by: Novice | last post by:
I can't seem to get my Custom WebControl to output a button whose click event is associated with a particular method. Here is the code I have right now that contains a panel and there is a...
7
by: djc | last post by:
I am using a repeater control to list 'detail' entries from a simple issue tracking system. These detail entries are MSDE2000 TEXT fields. For each one, I need to replace all the carriage...
1
by: tony | last post by:
Hello!! Hello Victor! I use a product called flygrid to create grid tables. In many of my forms I create such grid tables. Some columns in these grid tables is of type drop down list where I...
1
by: tom_8872 | last post by:
Need a Logo Design? Check out this Company! They made my logo for only $19.95! Though you might want to check it out. Here is the link:...
2
by: =?Utf-8?B?UmljaA==?= | last post by:
Is there a cancel argument for cancelling if you want to check or uncheck a checkbox? In the checkChanged event of a checkbox I ask the user if they are sure they want to check/uncheck...
1
by: QuickBooksDev | last post by:
VB.NET 2005 DataGridView Checkbox - Check Event need to know check status I would like to use the DataGridView Checkbox like a normal checkbox. When someone clicks on it I would expect that I...
1
by: Vyas111111 | last post by:
Hello All, How can i get the value of a gridview cell outside any GridView event
2
by: munkee | last post by:
All, I have a form with 5 tabs, which I navigate through using normal buttons on the page (for design aesthetics purely). Upon loading the form I want only three of these buttons to be enabled....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.