I have a page with a Grid on it.
Based on the selection of a ComboBox I dynamically add an appropriate GridView that has a ContextMenu (so far so good).
One of the ContextMenuItem options needs user input so I dynamically build and add controls to a Grid, and add the Grid as a child of the Grid on the Page (at the same time I hide the first child of the Grid (the GridView)).
The controls don’t appear in the expected positions. If I specify 0,0,0,0 they show up somewhere around the middle. If I specify -800, -400, 0,0 they show up close to where I want them to be but not where they are expected to be (the Grid itself is 800×400).
Am I missing something?
I’ve tried adding columns and rows and specifying position that way. I’ve tried setting margins of the controls directly. Nothing seems to work as expected.
Thanks
You should be using a
Canvasif you are positioning controls exactly. AGridis designed to position controls relatively, whereas it looks like you are trying to position them absolutely (within theGrid).