开发者

How do you span columns in C#?

开发者 https://www.devze.com 2023-03-18 15:10 出处:网络
How do you span columns in C#? In silverlight, suppose you have a grid, and this grid is in 3 columns.

How do you span columns in C#? In silverlight, suppose you have a grid, and this grid is in 3 columns. and you want to add a UserControl to this grid but you want it to span all three columns. How would that C# code look like?

 Grid1.Children.Add(U开发者_如何学编程serControl01);

But then what?

Grid1.Children.ElementAt(1).SetValue(Grid.SetRowSpan, 2);

??


I think you want something like this:

Grid1.Children.Add(UserControl01);
Grid.SetColumnSpan(UserControl01, 3);

MSDN Docs: http://msdn.microsoft.com/en-us/library/system.windows.controls.grid.setcolumnspan.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号