By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,049 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

checkboxes

P: n/a
hi,

i have created some checkboxes at runtime via a datalist control.

what code do i have to put on the server to determine which checkboxes have
been clicked?

any examples?

thanks
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Are you using Edit and Update? If so, you can tell during the Update command
processing. Use e.item.findcontrol to find the checkboxes, cast them to an
appropriate reference, and check the state.

"suzy" <su**@spam.com> wrote in message
news:kN*******************@pathologist.blueyonder. net...
hi,

i have created some checkboxes at runtime via a datalist control.

what code do i have to put on the server to determine which checkboxes have been clicked?

any examples?

thanks

Nov 18 '05 #2

P: n/a

It's not too different from dealing with a DataReader. You basically
iterate through the rows of the DataGrid ( using foreach ) and then select
the column and element inside the column, then cast it to the datatype that
you want to deal with.

Here's an article with some fairly explicit code examples:

http://www.c-sharpcorner.com/Code/20...ataGridVal.asp

I have just finished building a website in c# that does just this same
thing. It's tricky, but only in the sense of keeping track of where every
thing is. Remember, in each cell of the datagrid, you can treat all your
items as ASP Labels, TextBoxes, etc. That lets you iterate through the
collection at that level.

suzy wrote:
hi,

i have created some checkboxes at runtime via a datalist control.

what code do i have to put on the server to determine which checkboxes
have been clicked?

any examples?

thanks


--
W '04 <:> Open
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.