Hi Rogerio.
I see your code, but i dont know wxactly what is you want to do...
I dont know if this can help to you but generally i make something like
this:
I create the custom control
public class WizardControl:WebControl
{
protected override OnInit()
{
//Make an instance of the Collection base
//Call to a method to fill de collection
//Populate this control with the collection
}
}
public class WizardPages:CollectionBase
{
public void FillCollection()
{
//Instance to the class that takes the data
//Subscribing to the event created by you in the class where
you take the data (from database, or from xml file, etc...
}
public WizardPage Get_(int index)
{
return List[index]
}
public void Add_(WizardPage tempwizardpage)
{
List.Add(tempwizardpage);
}
public void Delete_(WizardPage tempwizardpage)
{
List.Delete(tempwizardpage);
}
private void WizardPageFound(object sender, EventArgs e)
{
WizardPage tempwizardpage=(WizardPage) sender;
this.Add_(tempwizardpage);
}
}
//For instance this could be a class to recover data...
public class Database()
{
//define the event (the event wich i will subscribe in the Wizards
Collection class.
public event EventHandler WizardFound;
//define the method that will fire the event
public virtual void OnWizardFound(object sender, EventArgs e)
{
if(WizardFount!=null)
{
WizardFound(sender,e);
}
}
//the method that will be take info from (for example) database
public void GetWizardPages()
{
//Connect to database
//Call stored procedure for example
//for each WizardPage got, call OnWizardFound()
//disconnect from database
}
}
I dont know if this case its similar than yours, but maybe gives to you
a light in the dark.
Hope this helps...
Regards.
Josema.