Page 1 of 1

Issue when adding new child elements to a Grid in codebehind.

Posted: 02 Aug 2022, 16:47
by peterh
We have a piece of code which can be simplified as:
public void DoStuff(Panel desiredParent, UserControl child) 
{
    desiredParent.Children.Add(child);
}
In Noesis 3.0, the child element would show up under the "desiredParent" element in Noesis Inspector, as well as render on screen without any extra steps.

After upgrading to 3.1.5, this no longer seems to be the case. When debugging, I can see that the element has been added to "desiredParent.Children" but I can't see it in the Inspector, nor does the element render on screen.

Do I need to take additional steps in 3.1, or is this a bug?

Re: Issue when adding new child elements to a Grid in codebehind.

Posted: 03 Aug 2022, 11:41
by sfernandez
Hi Peter,

I can't reproduce the problem, in my tests I can add elements in runtime to a panel and they show fine in the screen and in the Inspector.
Would it be possible to get a small sample that reproduces it?

Re: Issue when adding new child elements to a Grid in codebehind.

Posted: 03 Aug 2022, 13:11
by peterh
Hi, I managed to solve it.

For some reason I had two identical NoesisViews (probably some merge conflict resolution gone awry) running at the same time which caused events to be triggered by the top one, but processed by the bottom one.

Re: Issue when adding new child elements to a Grid in codebehind.

Posted: 03 Aug 2022, 16:01
by jsantos
Thank you, marking this as closed