How do you span columns in C#?

Discussion in 'Web Design & Coding' started by Complete, Jul 7, 2011.

  1. Complete

    Complete OSNN Addict

    Messages:
    94
    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(UserControl01);
    But then what?
    Grid1.Children.ElementAt(1).SetValue(Grid.SetRowSpan, 2); ??
     
  2. Complete

    Complete OSNN Addict

    Messages:
    94
    Grid1.Children.Add(UserControl02);
    Grid.SetColumnSpan(UserControl02, 3);
     
  3. LordOfLA

    LordOfLA Godlike!

    Messages:
    7,027
    Location:
    Maidenhead, Berkshire, UK
    Thanks for the update!