peterh
Topic Author
Posts: 39
Joined: 13 Mar 2015, 13:50

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

02 Aug 2022, 16:47

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?
 
User avatar
sfernandez
Site Admin
Posts: 2984
Joined: 22 Dec 2011, 19:20

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

03 Aug 2022, 11:41

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?
 
peterh
Topic Author
Posts: 39
Joined: 13 Mar 2015, 13:50

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

03 Aug 2022, 13:11

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.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

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

03 Aug 2022, 16:01

Thank you, marking this as closed

Who is online

Users browsing this forum: Ahrefs [Bot] and 6 guests