Sep 26, 2017, 3:08 PM
Load Components Dynamically
Hello,
I have created a few Checkboxes dynamycally, but I dont find out how can I load them to set them true.
Here is my code to create the CheckBoxes and it works pretty nice:
Now I want to set checked=true in every checkbox below the checkbox "TODO" when I press it, but I cant find the way to do it because i cant load them:
I have created a few Checkboxes dynamycally, but I dont find out how can I load them to set them true.
Here is my code to create the CheckBoxes and it works pretty nice:
string categoria = Calzado;
foreach (Familia familia in Familias)
{
i++;
string nombrefamilia = familia.Nombre;
Ext.Net.Checkbox checkfamilia = new Ext.Net.Checkbox();
checkfamilia.ID = nombrecategoria.TrimEnd() + i;
checkfamilia.BoxLabel = nombrefamilia;
checkfamilia.MarginSpec = "0 0 0 60";
checkfamilia.Cls = "normalbox";
checkGroupfamilia.Add(checkfamilia);
}
}
As a result I get this: Now I want to set checked=true in every checkbox below the checkbox "TODO" when I press it, but I cant find the way to do it because i cant load them:
public void Marcartodas(object sender, DirectEventArgs e)
{
int categoriaID = Int32.Parse(e.ExtraParams["cat"].TrimEnd());
DataBaseAccess dataBaseAccess = new DataBaseAccess(conexionBD);
dataBaseAccess.open();
CategoriaDao cat = new CategoriaDao(dataBaseAccess);
Categoria categoria = cat.getById(categoriaID);
FamiliaDao Fam = new FamiliaDao(dataBaseAccess);
List<Familia> Familias = Fam.GetByCategoria(categoriaID);
int i = 0;
foreach (Familia familia in Familias)
{
i++;
¿¿¿¿¿¿(categoria.nombre + i).Checked = true????
}
}