May 16, 2011, 10:14 PM
[CLOSED] How to remove Controls from a ContentControls collection in code-behind?
This question is probably related to a recent question I asked:
http://forums.ext.net/showthread.php...lling-the-data
However, in this case I am not populating a Store, but a ContentControl collection, see this thread:
http://forums.ext.net/showthread.php...in-code-behind
So in short: I am adding a UserControl (CoreComment) to a ContentControl collection (as can be seen in the thread linked above).
Each time I change the "object" (from a Combobox) I should populate the ContentControl with one instance of my CoreComment for each comment that that object has. But I first need to Clear it from previous UserControl, then populate. I cant seem to get that to work. I try this:
Any ideas?
Good night =)
http://forums.ext.net/showthread.php...lling-the-data
However, in this case I am not populating a Store, but a ContentControl collection, see this thread:
http://forums.ext.net/showthread.php...in-code-behind
So in short: I am adding a UserControl (CoreComment) to a ContentControl collection (as can be seen in the thread linked above).
Each time I change the "object" (from a Combobox) I should populate the ContentControl with one instance of my CoreComment for each comment that that object has. But I first need to Clear it from previous UserControl, then populate. I cant seem to get that to work. I try this:
this.PanelComments.ContentControls.Clear();
foreach(CoreCommons.System.Comment c in cg.Reply_Comments)
{
WebApplicationExtNetTest.Secure.UserControls.CoreComment cc = (WebApplicationExtNetTest.Secure.UserControls.CoreComment)this.LoadControl("/Secure/UserControls/CoreComment.ascx");
cc._Comment = c;
this.PanelComments.ContentControls.Add(cc);
}
this.PanelComments.UpdateContent();
But then usually nothing shows up at all - the Panel is just empty (which reminds me of this post).Any ideas?
Good night =)
Last edited by geoffrey.mcgill; May 18, 2011 at 6:47 PM.
Reason: [CLOSED]