Hello,
if we can position controls (buttons in this case) on a canvas using the canvas.top and canvas.left in the xaml for the given button, how can be position buttons dynamically added to a canvas at run-time?
Something like:
Canvas cvs = new Canvas;
RadButton btn = new RadButton
{
Tag = "btnONE", Width = 32, Height = 32, Content = "ONE"
}
cvs.Children.Add(btn);
Lets say I have 10 of these (obviously named/tagged differently) in a loop...the buttons should be 5 rows of 2 in the order they were added - ie: left, right, left, right for 5 rows...
How can I position each button? What I'm getting in my code is 10 btns on top of each other.
In xaml I have canvas.top="0" canvas.left="0"
then in next btn canvas.top="0" canvas.left="32"
then in next btn canvas.top="32" canvas.left="0"
then in next btn canvas.top="32" canvas.left="32"
etc etc etc.
Make sense?
Thanks