Silverlight (3.0): How to add cell padding to a Grid? -
How to add cell padding to a grid easily in Silverlight? There is a lot of noise to set the margin for each cell.
& lt; Grid.RowDefinitions & gt; & Lt; RowDefinition Height = "Auto" /> & Lt; RowDefinition Height = "Auto" /> & Lt; /Grid.RowDefinitions> & Lt; Grid.ColumnDefinitions & gt; & Lt; Column width = "Auto" /> & Lt; Column width = "*" /> & Lt; /Grid.ColumnDefinitions> & Lt; TextBlock Text = "Type:" Grid.Column = "0" Grid. Rau = "0" & gt; & Lt; / TextBlock & gt; & Lt; Combo box grid Column = "1" grid. Row = "0" & gt; & Lt; / Combo box & gt; & Lt; Text block text = "length:" grid. Column = "0" grid. Line = "1" & gt; & Lt; / Textblocks & gt; & Lt; Text Box Grid Column = "1" grid. Rau = "1" & gt; & Lt; / Textblocks & gt;
Someone might have me on the cross for the ugliness of this Solution will be offered, but you can set rows and columns with height and width in between your rows and columns in your padding values, including data:
& Lt; Roadfinion height = "4" /> & Lt; RowDefinition Height = "Auto" /> & Lt; /Grid.RowDefinitions> & Lt; Grid.ColumnDefinitions & gt; & Lt; Column width = "Auto" /> & Lt; Column width = "4" /> & Lt; Column width = "*" /> & Lt; /Grid.ColumnDefinitions> & Lt; TextBlock Text = "Test" Grid. Column = "0" grid. Line = "0" /> & Lt; TextBlock Text = "Test" Grid. Column = "0" grid. Line = "2" /> & Lt; TextBlock Text = "Test" Grid. Column = "2" grid. Line = "0" /> & Lt; TextBlock Text = "Test" Grid. Column = "2" grid. Line = "2" /> & Lt; / Grid & gt;
Comments
Post a Comment