Oct 24, 2019, 9:50 AM
[CLOSED] Dynamically adding
Hi!
I'm trying to dynamically add items to a panel using my controller (it needs to happen when I push a button).
I've got it adding to the panel in the code, but it doesn't appear on screen once the result is returned.
Here's some code:
I'm trying to dynamically add items to a panel using my controller (it needs to happen when I push a button).
I've got it adding to the panel in the code, but it doesn't appear on screen once the result is returned.
Here's some code:
public ActionResult LoadStyles()
{
List<vw_ClothingStyles> styles = (from x in db.vw_ClothingStyles
select x).ToList();
Panel mainStylesPanel = X.GetCmp<Panel>("StyleRowPanel");
foreach (vw_ClothingStyles style in styles)
{
Panel panel = new Panel()
{
FactoryAlias = "StyleCardPanel"
};
mainStylesPanel.Items.Add(panel);
}
mainStylesPanel.DoAutoRender();
return this.Direct();
}
I can also give you the code for my main panel if needed :)
Last edited by fabricio.murta; Oct 25, 2019 at 8:41 PM.