dpro1979

I apologize if this is the wrong area, but I couldn't find anything else that fits the subject quite right...

I've got a com object ( IE ) running and grabbing information, however when I try to populate a CheckboxList control, it simply refuses to fill the control with any data. Is there some weird interaction between the two I am unaware of

So basically, an event fires,and then data is processed, here's a quick snippet...

CheckBoxList checkBox;

checkBox = new CheckBoxList();

// Get the data, and now...

foreach(string dataItem in myData)

{

checkBox.Items.Add(dataItem);

}

After this is through I would expect my CheckBoxList to be populated, but it remains blank. Any ideas on why this might happen Thanks!



Re: Visual C# General COM object interfereing with a CheckBoxList?

Friendly Dog

When you trace the code, do you see the Items.Add method gets called does dataItem has value




Re: Visual C# General COM object interfereing with a CheckBoxList?

dpro1979

I didn't check dataItem, but Items.Add is called, and it returns the index of where the item should be. I put it into a Console.writeline method, and it spits out the correct data, and an index associated with it, but sadly nothing displays. I'll have to check the actual CheckBoxList and see what is in there when I can check it. It seems like nothing actually displays once I call SHDocVw.InternetExplorer. I'll fill this is in later when I can check the values. Thanks!

Actually yes I know dataItem's value, it is printed out correctly (sorry misunderstood your question).




Re: Visual C# General COM object interfereing with a CheckBoxList?

dpro1979

Basically to answer it myself, it turns out I had created a new CheckBoxList along the way for no reason. When I ran that code the other box stayed, but I guess I hadn't told my new'd variable anything, so it got the information as was valid, but simply didn't show up. So I the answer is, if you add something via the designer... don't add it again via a new.