Control & Style templates

Not Answered This post has 0 verified answers and 4 replies

Not Ranked
Posts: 8
kenan820 Posted: Tue Apr 6, 2010 @ 8:00 AM
Do you have a list of control and style templates available for your controls, especially DataGrid, like Microsoft does on MSDN for their controls?  I'm wanting to turn off the OnMouseOver highlight of a row on the DataGrid.  With a StyleTemplate, I can do that to Microsoft's Silverlight DataGrid.  I'm unable to get the DataGridRowStyle template to "show up" in Blend.  Everytime I attempt to work with DataGridRow, Blend throws an exception "Cannot create instance of DataGridRow".  So, I'm unable to create a copy of the templates to modify.

I'm primarily looking for the DataGridRow style template.

All Replies

Not Ranked
Posts: 8
kenan820 Posted: Tue Apr 6, 2010 @ 9:06 AM
I've attempted to use Themes and I'm still having no luck.  Here's the theme that I'm using to override the "generic.xaml" resource:

<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:ComponentArt="clr-namespace:ComponentArt.Silverlight.UI.Data;assembly=ComponentArt.Silverlight.UI.Data"
>
    <Style TargetType="Rectangle" x:Key="ComponentArt_DataGrid_RowHoverBackgroundRectangle">
        <Setter Property="Fill" Value="Transparent" />
    </Style>

    <Style TargetType="Border" x:Key="ComponentArt_DataGrid_RowHover">
        <Setter Property="Background" Value="Transparent" />
    </Style>

    <Style TargetType="Rectangle" x:Key="ComponentArt_DataGrid_RowSelectedBackgroundRectangle">
        <Setter Property="Fill" Value="Transparent" />
    </Style>
</ResourceDictionary>

I'm still getting the default "blue" highlight whenever I hover over the row or its details.
Not Ranked
Posts: 8
kenan820 Posted: Tue Apr 6, 2010 @ 9:14 AM
Here's some snippets of my xaml to make sure I'm doing this correctly:

<UserControl
    x:Class="MyProject.Silverlight.EntryDetail"
    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"
    mc:Ignorable="d"
    xmlns:dg="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:cart_data="clr-namespace:ComponentArt.Silverlight.UI.Data;assembly=ComponentArt.Silverlight.UI.Data"
    xmlns:cart_input="clr-namespace:ComponentArt.Silverlight.UI.Input;assembly=ComponentArt.Silverlight.UI.Input"
    xmlns:cart_common="clr-namespace:ComponentArt.Silverlight.UI;assembly=ComponentArt.Silverlight.UI.Common"
    xmlns:basic="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:dgprimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"
>

    <UserControl.Resources>
            <cart_common:Theme x:Key="CADataGridTheme"
                           BaseSource="/ComponentArt.Silverlight.UI.Navigation;component/Themes/generic.xaml"
                           Source="/MyProject.Silverlight;component/MyTheme/DataGridTheme.xaml" />
</UserControl.Resources>

...

            <cart_data:DataGrid x:Name="caDataGrid"
                                x:FieldModifier="private"
                                Background="White"
                                AutoGenerateColumns="False"
                                HeaderVisibility="Collapsed"
                                ColumnHeaderVisibility="Collapsed"
                                RowDetailsVisibilityMode="Expandable"
                                BorderThickness="0,1,0,1"
                                BorderBrush="#FFE77817"
                                CornerRadius="0"
                                AllowEditing="False"
                                AllowSelection="False"
                                VerticalScrollBarVisibility="Auto"
                                VerticalScrollMode="Live"
                                HorizontalScrollBarVisibility="Hidden"
                                RunningMode="Callback"
                                Width="875"
                                Height="285"
                                Margin="0"
                                FooterVisibility="Collapsed"
                                Theme="{StaticResource CADataGridTheme}"
                                RowLoaded="caDataGrid_RowLoaded"
                                PageIndexChanged="caDataGrid_PageIndexChanged">
Not Ranked
Posts: 8
kenan820 Posted: Fri Apr 9, 2010 @ 11:31 AM
Any news/ideas?
Not Ranked
Posts: 8
kenan820 Posted: Wed Apr 14, 2010 @ 5:31 AM
It's been over a week since the original post.  Can someone from the company please acknowledge that you've at least seen this post and are possibly looking into a solution?
Page 1 of 1 (5 items)