This is a migrated thread and some comments may be shown as answers.

Border issue

1 Answer 45 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sourabh
Top achievements
Rank 1
Sourabh asked on 15 Dec 2011, 01:36 PM
Hi There,

I am using radgridview control, I can see the extra border in the left side of the grid. While dragging the columns, i can see the border moves from column to column.

I also set the CanUserResizeColumns property to "false".

For your reference I am attaching images.

here is my XAML code.


<UserControl xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    x:Class="TreeListWebPart.DataGridControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
             xmlns:datagrid="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
             xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
             xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
             xmlns:local="clr-namespace:MWH.WebParts.TreeListWebPart"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:Telerik_Windows_Controls_GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
             xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
             mc:Ignorable="d">
    <UserControl.Resources>
        <local:DataGridColumnTypeControlConverter x:Key="DataGridColumnTypeControlConverter" />
        <!--<local:ColumnTypeControlConverter x:Key="ColumnTypeControlConverter" />-->


        <DataTemplate x:Key="HyperLinkTemplate">
            <ContentControl Loaded="ContentControl_Loaded" />
        </DataTemplate>


        <DataTemplate x:Key="HTMLTextTemplate">
            <ContentControl  Loaded="ContentControl_Loaded_2" />
        </DataTemplate>


        <DataTemplate x:Name="HyperLinkTemplate1">
            <ContentControl Grid.Row="0"
                            Grid.Column="0"
                            Padding="0,15,0,0"
                            VerticalContentAlignment="Stretch"
                            Content="{Binding bindingName, Converter={StaticResource DataGridColumnTypeControlConverter}, ConverterParameter='MultiHyperLink'}" />


        </DataTemplate>


        <DataTemplate x:Name="HTMLTextTemplate1">
            <local:HtmlRichTextBox HorizontalContentAlignment="Left"
                                           VerticalContentAlignment="Center"
                                           VerticalAlignment="Center"
                                           HorizontalAlignment="Left"
                                           Background="Transparent"
                                           TextBox="{Binding bindingName, Converter={StaticResource DataGridColumnTypeControlConverter}, ConverterParameter='Note'}">
            </local:HtmlRichTextBox>
        </DataTemplate>


        <DataTemplate x:Name="DefaultTemplate">
            <TextBlock VerticalAlignment="Center"
                       HorizontalAlignment="Left"
                       Name="bindingName"
                       Text="{Binding bindingName, Converter={StaticResource DataGridColumnTypeControlConverter}, ConverterParameter='Note'}"></TextBlock>
        </DataTemplate>


        <DataTemplate x:Name="MultiChoiceTemplate">
            <ContentControl VerticalAlignment="Center"
                            HorizontalAlignment="Left"
                            HorizontalContentAlignment="Left"
                            VerticalContentAlignment="Stretch"
                            Grid.Row="0"
                            Padding="1,0,0,0"
                            Content="{Binding bindingName, Converter={StaticResource DataGridColumnTypeControlConverter}, ConverterParameter='MultiChoice'}" />
        </DataTemplate>


        <DataTemplate x:Name="BooleanTemplate">
            <CheckBox Name="{Binding bindingName}"
                      IsChecked="{Binding bindingName , Converter={StaticResource DataGridColumnTypeControlConverter}, ConverterParameter='Note'}"></CheckBox>
        </DataTemplate>


        <DataTemplate x:Name="BasicTextTemplate">
            <Grid ShowGridLines="True">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <ContentControl Grid.Row="0"
                                Height="*"
                                VerticalAlignment="Stretch"
                                HorizontalContentAlignment="Stretch"
                                VerticalContentAlignment="Stretch"
                                Content="{Binding bindingName, Converter={StaticResource DataGridColumnTypeControlConverter}, ConverterParameter='Text'}" />
            </Grid>
        </DataTemplate>


        <DataTemplate x:Name="ImageCellTemplate">
            <ItemsControl x:Name="DetailColumns"
                          ItemsSource="{Binding Fields}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <Border BorderBrush="Black">
                                <!--<ContentControl Content="{Binding LinkToList, Converter={StaticResource DataGridColumnTypeControlConverter}, ConverterParameter='HyperlinkButton'}" />-->
                                <ContentControl  Content="{Binding Converter={StaticResource DataGridColumnTypeControlConverter}, Mode=TwoWay}" />
                            </Border>
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </DataTemplate>


        <!--<Style  TargetType="telerik:GridViewHeaderCell" x:Key="MyHeaderCellStyle">
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="BorderThickness" Value="0"/>
        </Style>-->


        <SolidColorBrush x:Key="GridView_HeaderInnerBorder" Color="#FF4B4B4B"/>
        <SolidColorBrush x:Key="GridView_HeaderOuterBorder_Over" Color="#FFFFC92B"/>
        <SolidColorBrush x:Key="GridView_HeaderInnerBorder_Over" Color="White"/>
        <LinearGradientBrush x:Key="GridView_HeaderBackground_Over" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFFFBA3" Offset="1"/>
            <GradientStop Color="#FFFFFBDA" Offset="0"/>
            <GradientStop Color="#FFFFD25A" Offset="0.43"/>
            <GradientStop Color="#FFFEEBAE" Offset="0.42"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="GridView_HeaderOuterBorder_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF616161" Offset="0"/>
            <GradientStop Color="#FF989898" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="GridView_HeaderInnerBorder_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFB69A78"/>
            <GradientStop Color="#FFFFE17A" Offset="0.126"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="GridView_HeaderBackground_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFFD74E" Offset="0.996"/>
            <GradientStop Color="#FFFFDCAB" Offset="0.17"/>
            <GradientStop Color="#FFFFB062" Offset="0.57"/>
            <GradientStop Color="#FFFFD18F" Offset="0.56"/>
            <GradientStop Color="#FFFFBA74"/>
        </LinearGradientBrush>
        <Style x:Key="StretchedContentControl" TargetType="ContentControl">
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        </Style>
        <SolidColorBrush x:Key="GridView_SortIndicatorColor" Color="Black"/>
        <telerik:Office_BlackTheme x:Key="Theme"/>
        <Style x:Key="ColumnHeaderGripperStyle" TargetType="Thumb">
            <Setter Property="Width" Value="8"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="Cursor" Value="SizeWE"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Thumb">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <SolidColorBrush x:Key="GridView_HeaderForeground_Selected" Color="Black"/>
        <ControlTemplate x:Key="GridViewHeaderCellTemplate" TargetType="Telerik_Windows_Controls_GridView:GridViewHeaderCell">
            <Grid x:Name="PART_HeaderCellGrid">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualStateGroup.Transitions>
                            <VisualTransition GeneratedDuration="00:00:00.2000000" To="Normal"/>
                            <VisualTransition GeneratedDuration="00:00:00.2000000" To="MouseOver"/>
                        </VisualStateGroup.Transitions>
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Over">
                                    <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
                                </DoubleAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridView_HeaderForeground_Selected}"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Ascending">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridView_HeaderForeground_Selected}"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Selected">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Descending">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridView_HeaderForeground_Selected}"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderTransform" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                        <DiscreteObjectKeyFrame.Value>
                                            <ScaleTransform ScaleY="1" ScaleX="1"/>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Selected">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Border x:Name="GridViewHeaderCell" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2">
                    <Border BorderBrush="{StaticResource GridView_HeaderInnerBorder}" BorderThickness="0,1,0,0" Background="{TemplateBinding Background}"/>
                </Border>
                <Border x:Name="GridViewHeaderCell_Over" BorderBrush="{StaticResource GridView_HeaderOuterBorder_Over}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" Opacity="0">
                    <Border BorderBrush="{StaticResource GridView_HeaderInnerBorder_Over}" BorderThickness="1" Background="{StaticResource GridView_HeaderBackground_Over}"/>
                </Border>
                <Border x:Name="GridViewHeaderCell_Selected" BorderBrush="{StaticResource GridView_HeaderOuterBorder_Selected}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" Opacity="0">
                    <Border BorderBrush="{StaticResource GridView_HeaderInnerBorder_Selected}" BorderThickness="1" Background="{StaticResource GridView_HeaderBackground_Selected}"/>
                </Border>
                <ContentControl x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="{TemplateBinding IsTabStop}" Margin="{TemplateBinding Padding}" Style="{StaticResource StretchedContentControl}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                <Path x:Name="PART_SortIndicator" Grid.ColumnSpan="2" Data="M0,0 L1,0 2,0 3,0 4,0 5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0 z" Fill="{StaticResource GridView_SortIndicatorColor}" HorizontalAlignment="Center" Height="3" Margin="0,3,0,0" Opacity="0" RenderTransformOrigin=".5,.5" Stretch="Fill" VerticalAlignment="Top" Width="5">
                    <Path.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleY="-1" ScaleX="1"/>
                            <SkewTransform AngleY="0" AngleX="0"/>
                            <RotateTransform Angle="0"/>
                            <TranslateTransform X="0" Y="0"/>
                        </TransformGroup>
                    </Path.RenderTransform>
                </Path>
                <Telerik_Windows_Controls_GridView:FilteringDropDown x:Name="PART_DistinctFilterControl" Grid.Column="1" Margin="0,0,8,0" telerik:StyleManager.Theme="{StaticResource Theme}" Visibility="{TemplateBinding FilteringUIVisibility}"/>
                <Thumb x:Name="PART_LeftHeaderGripper" Grid.ColumnSpan="2" HorizontalAlignment="Left" IsTabStop="{TemplateBinding IsTabStop}" Style="{StaticResource ColumnHeaderGripperStyle}"/>
                <Thumb x:Name="PART_RightHeaderGripper" Grid.ColumnSpan="2" HorizontalAlignment="Right" IsTabStop="{TemplateBinding IsTabStop}" Style="{StaticResource ColumnHeaderGripperStyle}"/>
            </Grid>
        </ControlTemplate>
        <LinearGradientBrush x:Key="GridView_HeaderBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <!--<GradientStop Color="#FF5B5B5B" Offset="1"/>
<GradientStop Color="#FF868686"/>
<GradientStop Color="#FF4F4F4F" Offset="0.42"/>
<GradientStop Color="#FF0E0E0E" Offset="0.43"/>-->
            <GradientStop Color="White" Offset="0.3"/>
            <GradientStop Color="LightSlateGray" Offset="1"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="GridView_HeaderOuterBorder" Color="#FF848484"/>
        <SolidColorBrush x:Key="GridView_HeaderForeground" Color="Black"/>
        <Style x:Key="GridViewHeaderCellStyle1" TargetType="Telerik_Windows_Controls_GridView:GridViewHeaderCell">
            <Setter Property="Template" Value="{StaticResource GridViewHeaderCellTemplate}"/>
            <Setter Property="Background" Value="{StaticResource GridView_HeaderBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource GridView_HeaderOuterBorder}"/>
            <Setter Property="BorderThickness" Value="0,0,1,1"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="5,0,3,0"/>
            <Setter Property="Foreground" Value="{StaticResource GridView_HeaderForeground}"/>
        </Style>








        <LinearGradientBrush x:Key="GridViewRowSelectedBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="LightBlue"  Offset="1"/>
            <GradientStop Color="LightBlue" Offset="0"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="GridViewInvalidBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFCDCDC"/>
            <GradientStop Color="#FFFCC1C1" Offset="1"/>
        </LinearGradientBrush>
        <telerik:BooleanToOpacityConverter x:Key="BooleanToOpacityConverter"/>
        <telerik:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <Telerik_Windows_Controls_GridView:GridLineWidthToThicknessConverter x:Key="GridLineWidthToThicknessConverter"/>
        <!--<telerik:Office_BlackTheme x:Key="Theme"/>-->
        <SolidColorBrush x:Key="GridViewRowIndicatorBackground" Color="#FFDBDEE1"/>
        <LinearGradientBrush x:Key="GridViewIndicatorsPartsFill" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF000000" Offset="0"/>
            <GradientStop Color="#FF000000" Offset="1"/>
        </LinearGradientBrush>
        <ControlTemplate x:Key="GridViewRowTemplate" TargetType="Telerik_Windows_Controls_GridView:GridViewRow">
            <ContentControl x:Name="ROOT" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Unfocused"/>
                        <VisualState x:Name="Focused">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicator" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="SelectionStates">
                        <VisualState x:Name="Unselected"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value=".5"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Selected">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ROOT" Storyboard.TargetProperty="Foreground">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Blue"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="ValueStates">
                        <VisualState x:Name="Valid"/>
                        <VisualState x:Name="Invalid">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InvalidBorder" Storyboard.TargetProperty="Opacity">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="EditStates">
                        <VisualState x:Name="EditMode">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicator" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditIndicator" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="ReadOnlyMode"/>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Telerik_Windows_Controls_GridView:SelectiveScrollingGrid x:Name="grid">
                    <Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.ColumnDefinitions>
                    <Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.RowDefinitions>
                    <Border x:Name="SelectionBackground" Margin="{TemplateBinding Margin}" MinHeight="{TemplateBinding MinHeight}" Grid.Column="2" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderBrush="{x:Null}" BorderThickness="0" Padding="{TemplateBinding Padding}"/>
                    <Rectangle x:Name="BackgroundRectangle" Fill="{StaticResource GridViewRowSelectedBackground}" Opacity="0" Grid.Column="2" Grid.ColumnSpan="2"/>
                    <Rectangle x:Name="InvalidBorder" Fill="{StaticResource GridViewInvalidBackground}" Opacity="0" Grid.Column="2" Grid.ColumnSpan="2"/>
                    <telerikGridView:GridViewToggleButton MinHeight="24" Width="24" IsHitTestVisible="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}}" Opacity="{Binding IsExpandable, Converter={StaticResource BooleanToOpacityConverter}, RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding HasHierarchy, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="2" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"/>
                    <Border Visibility="{Binding HasHierarchy, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="2" BorderBrush="{TemplateBinding VerticalGridLinesBrush}" BorderThickness="{Binding VerticalGridLinesWidth, Converter={StaticResource GridLineWidthToThicknessConverter}, ConverterParameter=Right, RelativeSource={RelativeSource TemplatedParent}}" Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"/>
                    <Telerik_Windows_Controls_GridView:DataCellsPresenter x:Name="PART_DataCellsPresenter" Grid.Column="3" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                    <Telerik_Windows_Controls_GridView:DetailsPresenter x:Name="PART_DetailsPresenter" Visibility="Collapsed" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="1" DetailsProvider="{TemplateBinding DetailsProvider}" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                    <ContentPresenter x:Name="PART_HierarchyChildPresenter" Visibility="{Binding IsExpanded, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="2"/>
                    <Border x:Name="PART_RowBorder" VerticalAlignment="Bottom" Grid.Column="1" Grid.ColumnSpan="4" Grid.RowSpan="4" BorderBrush="{TemplateBinding HorizontalGridLinesBrush}" BorderThickness="{Binding HorizontalGridLinesWidth, Converter={StaticResource GridLineWidthToThicknessConverter}, ConverterParameter=Bottom, RelativeSource={RelativeSource TemplatedParent}}"/>
                    <Telerik_Windows_Controls_GridView:IndentPresenter x:Name="PART_IndentPresenter" Background="{TemplateBinding Background}" Grid.Column="1" Grid.RowSpan="4" IndentLevel="{TemplateBinding IndentLevel}" Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                    <Border x:Name="PART_IndicatorPresenter" VerticalAlignment="Stretch" Width="24" Visibility="{TemplateBinding RowIndicatorVisibility}" Grid.Column="0" Grid.RowSpan="3" Background="{StaticResource GridViewRowIndicatorBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,1" Telerik_Windows_Controls_GridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
                        <Grid>
                            <Path x:Name="NavigatorIndicator" Fill="{StaticResource GridViewIndicatorsPartsFill}" Stretch="Fill" Height="8" HorizontalAlignment="Center" VerticalAlignment="Center" Width="5" Visibility="Collapsed" Data="M254.5,183.75 L254.5,193.33333 260.75,188.16682 z"/>
                            <Path x:Name="EditIndicator" Fill="Black" Stretch="Fill" Stroke="{x:Null}" Height="5" HorizontalAlignment="Center" VerticalAlignment="Center" Width="9" Visibility="Collapsed" Data="M0,4 L8,4 8,5 0,5 z M0,2 L8,2 8,3 0,3 z M0,0 L8,0 8,1 0,1 z"/>
                        </Grid>
                    </Border>
                </Telerik_Windows_Controls_GridView:SelectiveScrollingGrid>
            </ContentControl>
        </ControlTemplate>
        <SolidColorBrush x:Key="GridViewRowNormalBackground" Color="#FFF1F4F8"/>
        <SolidColorBrush x:Key="AlternamteGridViewRowNormalBackground" Color="#FFDEE2E1"/>
        <SolidColorBrush x:Key="GridLinesFill" Color="#FFB3B3B3"/>
        <SolidColorBrush x:Key="GridViewForeground" Color="#FF000000"/>
        <Style x:Key="GridViewRowStyle" TargetType="Telerik_Windows_Controls_GridView:GridViewRow">
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="Template" Value="{StaticResource GridViewRowTemplate}"/>
            <Setter Property="Background" Value="{StaticResource GridViewRowNormalBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource GridLinesFill}"/>
            <Setter Property="MinHeight" Value="24"/>
            <Setter Property="FontWeight" Value="Normal"/>
            <Setter Property="Foreground" Value="{StaticResource GridViewForeground}"/>
        </Style>


        <Style x:Key="AlternateGridViewRowStyle" TargetType="Telerik_Windows_Controls_GridView:GridViewRow">
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="Template" Value="{StaticResource GridViewRowTemplate}"/>
            <Setter Property="Background" Value="{StaticResource AlternamteGridViewRowNormalBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource GridLinesFill}"/>
            <Setter Property="MinHeight" Value="24"/>
            <Setter Property="FontWeight" Value="Normal"/>
            <Setter Property="Foreground" Value="{StaticResource GridViewForeground}"/>
        </Style>




        <LinearGradientBrush x:Key="GridView_HeaderRowBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="White" Offset="0.3"/>
            <GradientStop Color="LightSlateGray" Offset="1"/>
        </LinearGradientBrush>
        <Style TargetType="Telerik_Windows_Controls_GridView:GridViewHeaderIndentCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Telerik_Windows_Controls_GridView:GridViewHeaderIndentCell">
                        <Border x:Name="OuterBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="25">
                            <Border x:Name="InnerBorder" BorderBrush="{StaticResource GridView_HeaderInnerBorder}" BorderThickness="0" Background="{StaticResource GridView_HeaderBackground}"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="BorderThickness" Value="0,0,1,1"/>
            <Setter Property="Background" Value="{StaticResource GridView_HeaderRowBackground}"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="0"/>
        </Style>






        <SolidColorBrush x:Key="GridView_SortIndicatorColor_Sorted" Color="Black"/>
        <SolidColorBrush x:Key="GridView_IndicatorPrimaryColor" Color="Black"/>
        <ControlTemplate x:Key="CloseButtonTemplate" TargetType="Button">
            <Border x:Name="CloseButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="1" Height="11" Width="11">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Unfocused"/>
                        <VisualState x:Name="Focused"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="CloseButton">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridView_HeaderBackground_Over}"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="CloseButton">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridView_HeaderOuterBorder_Over}"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="Pressed"/>
                        <VisualState x:Name="Disabled"/>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Path Data="M4,4L5,4 5,5 4,5z M0,4L1,4 1,5 0,5z M3,3L4,3 4,4 3,4z M1,3L2,3 2,4 1,4z M2,2L3,2 3,3 2,3z M4,0L5,0 5,1 4,1 4,2 3,2 3,0.99999994 4,0.99999994z M0,0L1,0 1,0.99999994 2,0.99999994 2,2 1,2 1,1 0,1z" Fill="{StaticResource GridView_IndicatorPrimaryColor}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Height="5" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="5"/>
            </Border>
        </ControlTemplate>
        <SolidColorBrush x:Key="ControlBackground" Color="White"/>
        <SolidColorBrush x:Key="ControlOuterBorder" Color="#FF848484"/>
        <Style x:Key="ButtonCloseStyle" TargetType="Button">
            <Setter Property="Template" Value="{StaticResource CloseButtonTemplate}"/>
            <Setter Property="Background" Value="{StaticResource ControlBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
        </Style>
        <ControlTemplate x:Key="GridViewGroupPanelCellTemplate" TargetType="Telerik_Windows_Controls_GridView:GridViewGroupPanelCell">
            <Grid>
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualStateGroup.Transitions>
                            <VisualTransition GeneratedDuration="00:00:00.2000000" To="MouseOver"/>
                            <VisualTransition GeneratedDuration="00:00:00.2000000" To="Normal"/>
                        </VisualStateGroup.Transitions>
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="ContentElement">
                                    <EasingDoubleKeyFrame KeyTime="00:00:00" Value="-7"/>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_CloseButton">
                                    <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="SortDirection">
                        <VisualState x:Name="Ascending">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderTransform" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                        <DiscreteObjectKeyFrame.Value>
                                            <ScaleTransform ScaleY="-1" ScaleX="1"/>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Descending">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderTransform" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                        <DiscreteObjectKeyFrame.Value>
                                            <ScaleTransform ScaleY="1" ScaleX="1"/>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="None">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="PART_SortIndicator">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Border x:Name="OuterBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1">
                    <Border x:Name="InnerBorder" BorderBrush="{StaticResource GridView_HeaderInnerBorder}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                        <Grid>
                            <Path x:Name="PART_SortIndicator" Data="M0,0 L1,0 2,0 3,0 4,0 5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0 z" Fill="{StaticResource GridView_SortIndicatorColor_Sorted}" HorizontalAlignment="Center" Height="3" Margin="0,1,0,0" RenderTransformOrigin=".5,.5" Stretch="Fill" Visibility="Collapsed" VerticalAlignment="Top" Width="5"/>
                            <ContentControl x:Name="ContentElement" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="{TemplateBinding IsTabStop}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                <ContentControl.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </ContentControl.RenderTransform>
                            </ContentControl>
                            <Button x:Name="PART_CloseButton" HorizontalAlignment="Right" Margin="4,0" Opacity="0" Style="{StaticResource ButtonCloseStyle}" VerticalAlignment="Center"/>
                        </Grid>
                    </Border>
                </Border>
            </Grid>
        </ControlTemplate>
        <Style TargetType="Telerik_Windows_Controls_GridView:GridViewGroupPanelCell">
            <Setter Property="Template" Value="{StaticResource GridViewGroupPanelCellTemplate}"/>
            <Setter Property="Background" Value="{StaticResource GridView_HeaderBackground}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush" Value="{StaticResource GridView_HeaderOuterBorder}"/>
            <Setter Property="Padding" Value="20,0"/>
            <Setter Property="MinHeight" Value="24"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="Foreground" Value="{StaticResource GridView_HeaderForeground}"/>
        </Style>








    </UserControl.Resources>
    <Grid x:Name="_grid">
        <Border x:Name="_border">
            <StackPanel x:Name="stack">
                <telerik:RadGridView x:Name="DataGrid" AlternationCount="2"
                                     CanUserReorderColumns="False" RowIndicatorVisibility="Collapsed"                                     
                                     IsReadOnly="True"  RowStyle="{StaticResource GridViewRowStyle}" AlternateRowStyle="{StaticResource AlternateGridViewRowStyle}"
                                     AutoGenerateColumns="False"
                                     Visibility="Visible"
                                     SizeChanged="DataGrid_SizeChanged"
                                     DataLoadMode="Asynchronous"
                                     ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                                     ActionOnLostFocus="None"
                                     AreRowDetailsFrozen="True"
                                     CanUserDeleteRows="False"
                                     CanUserInsertRows="False"
                                     CanUserResizeColumns="False"                                     
                                     EditTriggers="None" >
                    <telerik:RadGridView.HeaderRowStyle>
                        <Style TargetType="telerik:GridViewHeaderRow">
                            <!--<Setter Property="BorderBrush" Value="Gray"/>-->
                            <Setter Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="White" Offset="0.3"/>
                                        <GradientStop Color="LightSlateGray" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderThickness" Value="0"/>
                        </Style>
                    </telerik:RadGridView.HeaderRowStyle>                    
                </telerik:RadGridView>
            </StackPanel>
        </Border>
        <StackPanel HorizontalAlignment="Center"
                    VerticalAlignment="Center">
            <TextBlock x:Name="TxtInfo"
                       Visibility="Collapsed"
                       Text="No Matching Records Found" />
        </StackPanel>
    </Grid>
</UserControl>



How can we remove the extra border?

Regards,
Sourabh Bose

1 Answer, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 15 Dec 2011, 02:03 PM
Hi Sourabh,


 
This border is actually the RadGridView's FrozenColumnSplitter. You may easily remove it through settting CanUserFreezeColumns property of the grid to False.


Greetings,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Sourabh
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or