Silverlight WrapPanel RadTreeView截止10像素

时间:2014-11-17 15:00:07

标签: c# silverlight wrappanel radtreeview

您好,感谢您的帮助。我有两个面板,一个带有一系列按钮,一个是由边框装箱的Telerik RadTreeView,右边是另一个包含网格和其他控件的边框。当我调整页面大小等时,所有内容的大小都是正确的,但由于某种原因,大约有10个像素被切断,无法想到原因。如果是页面容器问题,则会影响页面右侧的边框。所以我认为它必须与我正在使用的RadTreeView或WrapPanel有关。 (煮沸后的代码就在下面的图片后面)

Left black border shows the 10 pixels being cut-off, while the black border on the right shows the border to the grid extending the full length of the page.

<!-- Code -->
<controls:ViewBase xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                             xmlns:WindowControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
                             xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
                             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
                             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

    

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

  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
  </Grid.ColumnDefinitions>

  <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" x:Name="titleTxt" Text="My Title" Style="{StaticResource textBlockHeaderStyle}"/>

  <toolkit:WrapPanel Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Stretch" MaxWidth="400" Margin="2,2,2,10">   

        <!-- Some Buttons Here.... -->

            <telerik:RadTreeView HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SelectionMode="Single" IsLineEnabled="True"
                               ItemsOptionListType="None" IsOptionElementsEnabled="True" IsDragDropEnabled="False"
                               IsRootLinesEnabled="True" Margin="0,5,0,0" IsTriStateMode="True" FontSize="11" BorderThickness="1" BorderBrush="Black"/>

  </toolkit:WrapPanel>

  <sdk:GridSplitter Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Style="{StaticResource gridSplitterStyle}"/>

  <Border Grid.Row="1" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                Background="Transparent" BorderThickness="1" BorderBrush="Black">
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

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

      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>

      <Grid Grid.Row="0" Grid.Column="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">

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

        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid Grid.Row="0" Grid.Column="0">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
          </Grid.ColumnDefinitions>

            <!-- Some Buttons Here.... -->

        </Grid>

        <telerik:RadGridView  Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>

      </Grid>

    </Grid>
  </Border>

</Grid>

1 个答案:

答案 0 :(得分:0)

没有时间也不倾向于查看RadTreeView或WrapPanel的底层模板/样式。我能够解决问题并通过简单地将RadTreeView放在它自己的行中而只保留包装面板中的按钮和其他控件来维护布局。无论如何,假设它更简单。

绝对必须是这两个可能未解决的控件的错误或兼容性问题。