469,934 Members | 1,847 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

Problem with CheckboxList.Init

I am trying to do an example where you programatically add items to a
CheckBoxList by modifying the Init event of the control.

I tried the following code:

private void CheckBoxList1_Init(object sender, System.EventArgs e)


string[] genre = {
"SciFi","Religious","Action","Comedy","Drama","Thr iller" };

int i;

for (i = 0; i < genre.GetLength(0); i++)


CheckBoxList1.Items.Add(new ListItem(genre[i]));



I have the following wired:

private void InitializeComponent()


this.CheckBoxList1.Init += new System.EventHandler(this.CheckBoxList1_Init);

this.Load += new System.EventHandler(this.Page_Load);


Yet, when I do a debug breakpoint on the event method, it seems to never
fire, and the control isn't updated. It works fine from Page_Load though.

Nov 18 '05 #1
0 823

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Shaul Feldman | last post: by
4 posts views Thread by Bass Pro | last post: by
4 posts views Thread by Patrick.O.Ige | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.