Live Chat Icon For mobile
Live Chat Icon

How can I make sure that a GridSplitter Is visible ?

Platform: WPF| Category: GridSplitter

To prevent hidden GridSplitter controls, do one of the following :

  • Make sure that the GridSplitter controls are the last Children added to the Grid. The following example shows the GridSplitter as the last element in the Children collection of the Grid.
  • [XAML]
    
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
      </Grid.ColumnDefinitions>
      <Button Grid.Column='0'/>
      <GridSplitter Grid.Column ='0' Background='Blue'/>
    </Grid>
    
  • Set the ‘Zindex’ Property on the GridSplitter to be higher than a control that would otherwise hide it. The following example gives the GridSplitter control a higher ’Zindex’ Property than the Button control.
  • [XAML]
    
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
      </Grid.ColumnDefinitions>
      <GridSplitter Grid.Column='0' Background='Blue'
                    Panel.ZIndex='1'/>
      <Button Grid.Column='0'/>
    </Grid>
    
    
  • Set margins on the control that would otherwise hide the GridSplitter so that the GridSplitter is exposed. The following example sets margins on a control that would otherwise overlay and hide the GridSplitter.
  • [XAML]
    
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
      </Grid.ColumnDefinitions>
      <GridSplitter Grid.Column ='0' Background='Blue'/>
      <Button Grid.Column='0' Margin='0,0,5,0'/>
    </Grid>
    
    

    Share with

    Share on twitter
    Share on facebook
    Share on linkedin

    Related FAQs

    Couldn't find the FAQs you're looking for?

    Please submit your question and answer.