locked
Datagrid header make visiblity=colapsed RRS feed

  • Question

  • Hi please any one help me...

    I am using silverlight 4

    I want to set visibility=colapsed in datagrid each column  header seperater line.

    Monday, January 3, 2011 4:26 AM

Answers

  • Hi,

    You can use below style

    <Style x:Key="DataGridColumnHeaderStyle3" TargetType="sdk:DataGridColumnHeader">
       <Setter Property="SeparatorVisibility" Value="Collapsed" />
    </Style>

    and set HeaderStyle of DataGrid like below

    <sdk:DataGrid  x:Name="dg" ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle3}" />

    Best Regards,

    Friday, January 7, 2011 3:15 AM

All replies

  • Hi,

    Use Expression blend config Style and Template

    Regards

    Monday, January 3, 2011 4:56 AM
  • try following as well

    http://forums.silverlight.net/forums/p/174187/392129.aspx

     xmlns:localprimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"

    <sdk:DataGridTextColumn x:Name="foreNameColumn" Binding="{Binding Path=ForeName}" Header="Fore Name" Width="SizeToHeader" >
                            <sdk:DataGridTextColumn.HeaderStyle>
                                <Style TargetType="localprimitives:DataGridColumnHeader">
                                    <Setter Property="SeparatorVisibility" Value="Collapsed"/>
                                </Style>
                            </sdk:DataGridTextColumn.HeaderStyle>
                        </sdk:DataGridTextColumn>

    <sdk:DataGridTextColumn x:Name="foreNameColumn" Binding="{Binding Path=ForeName}" Header="Fore Name" Width="SizeToHeader" >

                            <sdk:DataGridTextColumn.HeaderStyle>

                                <Style TargetType="localprimitives:DataGridColumnHeader">

                                    <Setter Property="SeparatorVisibility" Value="Collapsed"/>

                                </Style>

                            </sdk:DataGridTextColumn.HeaderStyle>

                        </sdk:DataGridTextColumn>

    Monday, January 3, 2011 5:06 AM
  • Hi,

    You can use below style

    <Style x:Key="DataGridColumnHeaderStyle3" TargetType="sdk:DataGridColumnHeader">
       <Setter Property="SeparatorVisibility" Value="Collapsed" />
    </Style>

    and set HeaderStyle of DataGrid like below

    <sdk:DataGrid  x:Name="dg" ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle3}" />

    Best Regards,

    Friday, January 7, 2011 3:15 AM