Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1420
< Grid > issue
posted

Hi,

I have a simple <Grid> XAML element:

<Grid Name="grdListOfTickets">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="125"></ColumnDefinition>
<ColumnDefinition Width="125"></ColumnDefinition>
<ColumnDefinition Width="95"></ColumnDefinition>
<ColumnDefinition Width="90"></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
<ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="122"></ColumnDefinition>
<ColumnDefinition Width="130"></ColumnDefinition>
<ColumnDefinition Width="113"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>

How do I dinamically add a Row  and put a new instance of TextBox inside each cell. I am adding a new row definition like this:

RowDefinition rd = new RowDefinition();
grdListOfTickets.RowDefinitions.Add(rd);

I add child controls like this:

TextBox txt1 = new TextBox();

 grdListOfTickets.Children.Add(txt1);

 But I don't know how to assign Grid.Row="2" Grid.Row="6" to each new child control ??

 Best regards,

Marko.

 

 

 

 

 

 

 

Parents
No Data
Reply Children
No Data