2012-01-27 15 views
17

मेरे पास 3 पंक्तियों के साथ ग्रिड लेआउट है। मैं तीसरी पंक्ति को 2 कॉलम में कैसे विभाजित करूं।ग्रिड पंक्ति को दो कॉलम में कैसे विभाजित करें?

<Grid.RowDefinitions> 
    <RowDefinition Height="0.75*"/> 
    <RowDefinition Height="0.25*"/> 
    <RowDefinition Height="36"/> 
</Grid.RowDefinitions> 

उत्तर

38

दो तरीके जिनसे आप यह कर सकते हैं:

  • उपयोग नेस्टेड लेआउट। तीसरी पंक्ति में एक और Grid डालें, और उस उप-ग्रिड में दो कॉलम रखें। एक Grid साथ

    <Grid> 
        <Grid.RowDefinitions> ... </Grid.RowDefinitions> 
        <ThingInFirstRow Grid.Row="0" /> 
        <ThingInSecondRow Grid.Row="1" /> 
        <Grid Grid.Row="2"> 
         <Grid.ColumnDefinitions> 
          <ColumnDefinition /> 
          <ColumnDefinition /> 
         </Grid.ColumnDefinitions> 
         <ThingInLowerLeft Grid.Column="0" /> 
         <ThingInLowerRight Grid.Column="0" /> 
        </Grid> 
    </Grid> 
    
  • स्टिक, यह दो कॉलम देते हैं, और पहली दो पंक्तियों में बातें ColumnSpan का उपयोग कर दोनों स्तंभ पर होते हैं।

    <Grid> 
        <Grid.RowDefinitions> ... </Grid.RowDefinitions> 
        <Grid.ColumnDefinitions> 
         <ColumnDefinition /> 
         <ColumnDefinition /> 
        </Grid.ColumnDefinitions> 
        <ThingInFirstRow Grid.Row="0" Grid.ColumnSpan="2" /> 
        <ThingInSecondRow Grid.Row="1" Grid.ColumnSpan="2" /> 
        <ThingInLowerLeft Grid.Row="2" Grid.Column="0" /> 
        <ThingInLowerRight Grid.Row="2" Grid.Column="1" /> 
    </Grid> 
    
संबंधित मुद्दे