none
how can i add splitter in WPF application . code is here..

    Question

  • hi all ,

    i m wokring on WPF C#.

    in my WPF xaml file i added datagrid and toolbar . i wann to use the splitter for these . so user can easily view data by resizing the datagrid by using splitter .

    it seemes tat thr is no such splitter in WPF . my xaml code is as bellow . hw can i add the splitter in it ?

    thx in advance

    <Window x:Class="ProjectProperty.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
         
        Title="Window1" Height="595" Width="673">
        <Grid >
           
            <my:DataGrid Margin="0,135,119,15" Name="dataGrid1" HorizontalAlignment="Right" Width="532">
            </my:DataGrid>
            
            <Button Height="23" HorizontalAlignment="Right" Margin="0,145,26.25,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click_1">Button</Button>
            <ToolBar Height="102.5" Name="toolBar1" VerticalAlignment="Top" />
            <Button Height="28" Margin="0,60,0,0" Name="button2" VerticalAlignment="Top" HorizontalAlignment="Right" Width="113">Load Dirct</Button>
            <Button Height="28" Name="button3" VerticalAlignment="Top" Margin="0,15,1,0" HorizontalAlignment="Right" Width="112">Load Ref Proj</Button>
            <TextBox Height="28" Margin="19,15,119,0" Name="textBox1" VerticalAlignment="Top" />
            <TextBox Height="28" Margin="20,60,119,0" Name="textBox2" VerticalAlignment="Top" />
           
        </Grid>
    
    Friday, November 06, 2009 5:57 AM

Answers

All replies

  • hi all ,

    i m wokring on WPF C#.

    in my WPF xaml file i added datagrid and toolbar . i wann to use the splitter for these . so user can easily view data by resizing the datagrid by using splitter .

    it seemes tat thr is no such splitter in WPF . my xaml code is as bellow . hw can i add the splitter in it ?

    thx in advance

    <Window x:Class="ProjectProperty.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
         
        Title="Window1" Height="595" Width="673">
        <Grid >
           
            <my:DataGrid Margin="0,135,119,15" Name="dataGrid1" HorizontalAlignment="Right" Width="532">
            </my:DataGrid>
            
            <Button Height="23" HorizontalAlignment="Right" Margin="0,145,26.25,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click_1">Button</Button>
            <ToolBar Height="102.5" Name="toolBar1" VerticalAlignment="Top" />
            <Button Height="28" Margin="0,60,0,0" Name="button2" VerticalAlignment="Top" HorizontalAlignment="Right" Width="113">Load Dirct</Button>
            <Button Height="28" Name="button3" VerticalAlignment="Top" Margin="0,15,1,0" HorizontalAlignment="Right" Width="112">Load Ref Proj</Button>
            <TextBox Height="28" Margin="19,15,119,0" Name="textBox1" VerticalAlignment="Top" />
            <TextBox Height="28" Margin="20,60,119,0" Name="textBox2" VerticalAlignment="Top" />
           
        </Grid>
        
    • Merged by Jing0 Monday, November 09, 2009 8:09 AM dup
    Friday, November 06, 2009 5:51 AM
  • Something like this should do the trick

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="5"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <Button Grid.Row="0">Top</Button>
    
            <GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" Background="Blue" Grid.Row="1" ResizeBehavior="PreviousAndNext"></GridSplitter>
            <Button Grid.Row="2">Bottom</Button>
        </Grid>
    
    Regards,
    Matt
    Friday, November 06, 2009 6:02 AM