checkboxes and checkboxelist

G

Guest

When I add checkboxes dynamically, I can set several attributes(id,
eventhandlers specific to checkboxes....) in code.

I decided to use the checkboxlist to generate several checkboxes dynamically
instead of looping and writing a lot of code
1st question :How can I give each checkbox an identity from the datasource
and an eventhandler for one of a checkbox's events in code.
for example CheckBoxList doesn't have "CheckedChanged" event whereas Ineed
to specify it for each checkbox

what I need todois something like that

Dim obj As CheckBoxList = DirectCast(rdoControl, CheckBoxList)
obj.ID = extract_DataView.Table.Columns("SEPO_Option_Item_ID").ToString
obj.DataTextField =
extract_DataView.Table.Columns("SEOI_Description").ToString
obj.ToolTip =
extract_DataView.Table.Columns("SEOI_Option_Code").ToString
AddHandler MY CHILDRENS, delegates(EventHandlerName)
obj.RepeatColumns = 1

Any doc or examples somewhere

thanks
 
K

Kevin Yu [MSFT]

Hi,

Do you need to get an event fired when an item of the CheckboxList is
clicked and its value is changed.

I think you can handle the SelectedIndexChanged event to achieve this.
First of all, you have to set the CheckBoxList.AutoPostback property to
true. When this event is fired, you have to iterate through each item of
the CheckboxList to check for the changes.

Kevin Yu
Microsoft Online Community Support

============================================================================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
============================================================================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top