TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ravi Shekhar
359
4.5k
2.1m
Getting problem with wpf datagrid in 3.5 framework
May 19 2014 5:15 AM
I am getting msg "The DataGridRowHeader was not found"
I am using below code to add and design datagrid. This code is working when i change framework 4.0 but in 3.5 getting error msg. Need help.
<my:DataGrid AutoGenerateColumns="False" Height="Auto" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="5"
RowHeaderWidth="25" HorizontalAlignment="Left" Margin="90,50,0,0" VerticalAlignment="Top" x:Name="dgvDetails" Width="810"
GridLinesVisibility="None" CanUserAddRows="True" CanUserResizeRows="False" SelectionMode="Single" FontFamily="Arial" >
<my:DataGrid.RowStyle>
<Style TargetType="my:DataGridRow">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" >
<Setter.Value>
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0">
<GradientStop Color="#FFCA78" Offset="0.0"/>
<GradientStop Color="#FFFFFF" Offset="0.90"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
<Setter Property="Height" Value="28" />
</Style>
</my:DataGrid.RowStyle>
<my:DataGrid.RowHeaderStyle>
<Style TargetType="{x:Type DataGridRowHeader}">
<Setter Property="Background" Value="#DADDE8" />
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="#A9ADB2"/>
</Style>
</my:DataGrid.RowHeaderStyle>
<my:DataGrid.ColumnHeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="Background" Value="#DADDE8" />
<Setter Property="Height" Value="32" />
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="#A9ADB2"/>
<Setter Property="Padding" Value="30,0,0,0"/>
<Setter Property="FontWeight" Value="Bold"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="ToolTip" Value="Click to sort."/>
<Setter Property="Background" >
<Setter.Value>
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0">
<GradientStop Color="#FFFFFF" Offset="0.10"/>
<GradientStop Color="#FFC37C" Offset="0.80"/>
<GradientStop Color="#FFFFFF" Offset="0.10"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#FFC989" />
<Setter Property="BorderThickness" Value="0.5,0.5,0.5,0.5" />
</Trigger>
</Style.Triggers>
</Style>
</my:DataGrid.ColumnHeaderStyle>
<my:DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderBrush" Value="#A9ADB2"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFCA78" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="BorderThickness" Value="1,1,0,1"/>
</Trigger>
</Style.Triggers>
</Style>
</my:DataGrid.CellStyle>
<my:DataGrid.Columns>
<my:DataGridTextColumn Header="ORDERNO"
Binding="{Binding ORDERNO, Mode=TwoWay}" Width="*" />
<my:DataGridTextColumn Header="ARTNO"
Binding="{Binding ARTNO}" Width="*" />
<my:DataGridTextColumn Header="QTY"
Binding="{Binding QTY}" Width="*" />
</my:DataGrid.Columns>
</my:DataGrid>
Reply
Answers (
0
)
WPF Label Printing (DPL)
How to Bind in WPF With MVVM Pattern!..With Example