Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

datagrid border or column header bug... RSS

3 replies

Last post Nov 24, 2008 05:43 PM by ken tucker

(0)
  • Rahman_Hadi

    Rahman_Hadi

    0 Points

    4 Posts

    datagrid border or column header bug...

    Nov 22, 2008 06:15 AM | LINK

    Hi all - Im the new comer in this silverlight programming and now i has already waste my time for almost a day to searching the way how to remove thin border that always show up in the top of datagrid control unless setting property columnheader and border and everything its related change to null. but why there is thin broder in the top of datagrid? my snapshot code: {Any help ... I really appreciate... make me so stress to face this graphic stuff ..:) }

    <data:DataGrid x:Name="SalableCuGrid"

    HorizontalScrollBarVisibility="Hidden"

    VerticalScrollBarVisibility="Hidden"

    Width="166" Height="Auto"

    IsReadOnly="True"

    RowHeight="16"

    AlternatingRowBackground="{x:Null}" RowBackground="{x:Null}"

    SelectedIndex="-1" BorderThickness="0" AutoGenerateColumns="False"

    SelectionMode="Single" HeadersVisibility="None"

    HorizontalGridLinesBrush="{x:Null}" VerticalGridLinesBrush="{x:Null}"

    CanUserSortColumns="False" CanUserResizeColumns="False" Background="{x:Null}"

    CanUserReorderColumns="False" Foreground="{x:Null}" BorderBrush="{x:Null}"

    >

  • Ken Tucker

    Ken Tucker

    All-Star

    23246 Points

    3532 Posts

    Re: datagrid border or column header bug...

    Nov 22, 2008 12:03 PM | LINK

    In the view menu select open in expression blend.  You can download a trial of expression blend 2 here

     http://www.microsoft.com/downloads/details.aspx?FamilyId=5FF08106-B9F4-43CD-ABAD-4CC9D9C208D7&displaylang=en

    In blend right click on the datagrid and select Edit Control Parts (Template)  ---> Edit a copy.  This will add a copy of all the datagrid styles for you to edit.  You can use blend or visual studio to customize the datagrid.

  • Rahman_Hadi

    Rahman_Hadi

    0 Points

    4 Posts

    Re: datagrid border or column header bug...

    Nov 24, 2008 07:36 AM | LINK

    Thank you so much - it is really helpfull so i can customize all template which is working on datagrid and the problem is there is rectangle between header & grid body so i remove it ... :)

    <System_Windows_Controls_Primitives:DataGridColumnHeader x:Name="TopRightCornerHeader" Template="{StaticResource TopRightHeaderTemplate}" Grid.Column="2"/>

    <!--<Rectangle Height="1" x:Name="ColumnHeadersAndRowsSeparator" VerticalAlignment="Bottom" Width="Auto" Grid.ColumnSpan="3" Fill="#FFDBDCDC" StrokeThickness="1" />-->

    <System_Windows_Controls_Primitives:DataGridRowsPresenter x:Name="RowsPresenter" Grid.ColumnSpan="2" Grid.Row="1"/>

     

  • Ken Tucker

    Ken Tucker

    All-Star

    23246 Points

    3532 Posts

    Re: datagrid border or column header bug...

    Nov 24, 2008 05:43 PM | LINK

     Try making its fill transparent