2011-04-13 17 views
9

मैं निम्नलिखित ग्रिडGridSplitter सही ढंग से बंटवारे नहीं

<Grid>   
    <Grid.RowDefinitions> 
     <RowDefinition Height="Auto" /> 
     <RowDefinition Height="Auto" /> 
     <RowDefinition Height="*" /> 
     <RowDefinition Height="Auto" /> 
     <RowDefinition Height="Auto" /> 
     <RowDefinition Height="*" /> 
    </Grid.RowDefinitions> 

मेरी GridSplitter पंक्ति 3 (4 पंक्ति) पर है, इस प्रकार निर्धारित करें:

<GridSplitter Grid.Row="3" 
       ResizeDirection="Rows" 
       Style="{StaticResource HorizontalGridSplitter}" 
       IsTabStop="False" /> 
<Style x:Key="HorizontalGridSplitter" 
     TargetType="{x:Type GridSplitter}"> 
    <Setter Property="Height" 
      Value="4" /> 
    <Setter Property="HorizontalAlignment" 
      Value="Stretch" /> 
    <Setter Property="VerticalAlignment" 
      Value="Stretch" /> 
    <Setter Property="Margin" 
      Value="0" /> 
</Style> 

जब मैं आदेश को विभाजित करने में विभाजन खींचें पंक्ति 2/4, यह वास्तव में पंक्तियों को विभाजित नहीं करता है, ऐसा लगता है जैसे ग्रिड ऊंचाई बड़ी हो जाती है।

+0

मुझे एक ही समस्या थी, दुर्भाग्य से मुझे याद नहीं आया कि मैंने इसे कैसे हल किया ... –

उत्तर

24

GridSplitter, तीन अलग-अलग आकार के व्यवहार के रूप में आप नीचे देख सकते हैं:

Resize Behaviours

GridSplitter फिर से आकार का चयन किया ResizeBehaviour के अनुसार और के लिए उपलब्ध स्थान के अनुसार निर्दिष्ट दो कॉलम/पंक्तियों उन्हें, आपके मामले में आपने पहले पंक्ति के लिए ऊंचाई निर्दिष्ट की है, और बाद में पंक्ति के लिए ऑटो ऊंचाई, जिसका अर्थ है कि यह केवल पहले पंक्ति को फिर से आकार दे सकता है, पंक्ति हमेशा Auto:

enter image description here

इस मुद्दे आप Width="*" करने के बाद से पहले पंक्ति और पंक्ति की स्थापना की और निम्नलिखित कोड का टुकड़ा देख ResizeBehavior="PreviousAndNext" के लिए फिर से आकार व्यवहार सेट करने के लिए ठीक करने के लिए:

<Grid> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="Auto" /> 
     <RowDefinition Height="Auto" /> 
     <RowDefinition Height="*" /> 
     <RowDefinition Height="Auto" /> 
     <RowDefinition Height="*" /> 
     <RowDefinition Height="Auto" /> 
    </Grid.RowDefinitions> 
    <GridSplitter Grid.Row="3" ResizeDirection="Rows" 
        Style="{StaticResource HorizontalGridSplitter}"      
        IsTabStop="False" HorizontalAlignment="Stretch" 
        ResizeBehavior="PreviousAndNext" /> 
</Grid> 

यह भी बेहतर स्थापित करने के लिए Auto पर किसी भी अजीब व्यवहार से बचने के लिए अन्य सभी पंक्तियों की ऊंचाई :)

संबंधित मुद्दे