473,773 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

html checkboxes in datagrid

i have a datagrid with a column of html checkboxes which are created
dynamically. The id/name of the checkboxes comes from a value in the
database.

on a postback, i would like to get all the checked checkboxes, in the
same way old asp would.
i.e. for each control in Request.Form...

i am doing it this way because the datagrid will contain too much info
to maintain viewstate; i don't want to use session variables to hold
data key info; i don't want to re-create server checkboxes to get
whether they've been checked.

in any case, why doesn't matter. i would just like to know if someone
could provide me with loop code to get html checkbox names (which
have been checked obviously) which have been created dynamically in a
datagrid.

Nov 16 '05 #1
2 1711
hi
i have written on article on it long time ago
check this link
http://www.codeproject.com/aspnet/ChkBoxInGrid.asp

regards
Ansil
Trivandrum
an****@gmail.co m
"Mortar" wrote:
i have a datagrid with a column of html checkboxes which are created
dynamically. The id/name of the checkboxes comes from a value in the
database.

on a postback, i would like to get all the checked checkboxes, in the
same way old asp would.
i.e. for each control in Request.Form...

i am doing it this way because the datagrid will contain too much info
to maintain viewstate; i don't want to use session variables to hold
data key info; i don't want to re-create server checkboxes to get
whether they've been checked.

in any case, why doesn't matter. i would just like to know if someone
could provide me with loop code to get html checkbox names (which
have been checked obviously) which have been created dynamically in a
datagrid.

Nov 16 '05 #2

nice article, but like i said in my original post, i don't want to
maintain viewstate on the datagrid like you have in your example,
because there will be too much data being maintained.

On Wed, 2 Feb 2005 20:35:03 -0800, "=?Utf-8?B?QW5zaWwgTUN BRA==?="
<An*******@disc ussions.microso ft.com> wrote:
hi
i have written on article on it long time ago
check this link
http://www.codeproject.com/aspnet/ChkBoxInGrid.asp

regards
Ansil
Trivandrum
an****@gmail.c om
"Mortar" wrote:
i have a datagrid with a column of html checkboxes which are created
dynamically. The id/name of the checkboxes comes from a value in the
database.

on a postback, i would like to get all the checked checkboxes, in the
same way old asp would.
i.e. for each control in Request.Form...

i am doing it this way because the datagrid will contain too much info
to maintain viewstate; i don't want to use session variables to hold
data key info; i don't want to re-create server checkboxes to get
whether they've been checked.

in any case, why doesn't matter. i would just like to know if someone
could provide me with loop code to get html checkbox names (which
have been checked obviously) which have been created dynamically in a
datagrid.


Nov 16 '05 #3

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

Similar topics

1
2051
by: kannadasan | last post by:
Hi all I am using Datagrid where i place checkboxes in one column with some other columns.The purpose is, if i select the checkboxes and clicks the submit buton Email has to go to the selected Categories. The problem here is after clicking submit button i found the checkboxes are not unchecked (cleared) even though i put EnableViewState="False".
7
2421
by: DJ Dev | last post by:
Hi All, I have a complex problem. I have dropdownlists (usually 3-5) and the user selects some value from these and for each value selected, datagrids are shown to the user. I am creating the Datagrids dynamically using a loop depending on the number of Dropdownlists. The datagrids also have a checkbox template column. Now my problem is that how can I access the values selected by the user from these checkboxes. He checks one or more...
2
3195
by: john | last post by:
I posted this question to comp.lang.javascript but didn't get a response, so I'll try here. I am using ASP.NET and I have a datagrid. One of the columns in my grid is all checkboxes. When the user clicks on a certain button on the page, which is not in the grid, I want to be able to traverse through all the checkboxes in that column and see how many are checked. This is so that I can give them a confirmation dialog before I do an action...
0
1117
by: Angela | last post by:
Hi I have a datagrid with checkboxes besides a list of names. What I want is for the user to select the checkboxes and press 'Preview' and a new window opens with a print friendly list of the selected contact details. I can get the selected IDs via my server side code but can't target a new window to open.
2
2468
by: Mortar | last post by:
i have a datagrid with 2 columns. the 1st column contains an id which will be used by the database for the selected checkbox records. the 2nd column is a template column containing a server checkbox control. where i'm at: i can retrieve a count of the selected checkboxes, but don't know how to get the related id's (in the 1st column).
4
1952
by: Jim Bancroft | last post by:
Hi everyone, I'm using a DataGrid with TemplateColumns. My DataGrid is located in a cell of an asp:Table. I did this so it's positioned correctly onscreen. One of the DataGrid's TemplateColumns is a checkbox. During the page's postback I loop over the DataGrid and read the checkbox values. My problem is, none of the checkboxes ever have their "Checked" attribute set-- it's as though anything I mark is ignored.
3
1809
by: GatorBait | last post by:
Hi all, I'm using a datagrid for the first time and I am running into some problems that I hope someone can help me with. I have a datagrid with 18 rows and 5 columns....column 1 is just text and columns 2-5 are checkboxes. Some of the checkboxes have to be invisible, and in some cases some of the checkboxes have be be enabled=false. I have it now so that the entire grid is populated correctly, but I am having an extremely difficult...
7
2517
by: rn5a | last post by:
The first column of a DataGrid has a CheckBox for all the rows. I want that when users check a CheckBox, the BackColor of that entire row in the DataGrid should change to a different color. To implement this, if I am not mistaken, I HAVE TO post the Form first i.e. set the AutoPostBack property of the CheckBox to True. Without posting the Form, I don't think the BackColor of the checked row can be changed using ASP.NET, isn't it? Of...
10
5208
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked. I set the AutoPostBack property of the CheckBox in the Header to True & am invoking a sub named 'CheckAllRows' on the CheckedChanged event of this CheckBox. The CheckBox in the Header exists within the HeaderTemplate of a TemplateColumn in the...
0
9621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.