Just in case anyone else tries to use Jordan's dodgy code... heheh... If you try to use that Style in Silverlight 2 make sure you add spaces to the names of the states. ie NormalAlternatingRow should be Normal AlternatingRow, MouseOverSelected should be MouseOver Selected... and so on. I'm just sayin...
Thanks all for the replies. :) cheers, Stephen On Tue, Aug 11, 2009 at 4:21 PM, Jordan Knight <[email protected]>wrote: > Here ya go, lifted it using reflector :) > > > > > > <Style TargetType="local:DataGridRow"> > > <Setter Property="IsTabStop" Value="False" /> > > <Setter Property="Template"> > > <Setter.Value> > > <ControlTemplate TargetType="local:DataGridRow"> > > <localprimitives:DataGridFrozenGrid Name="Root"> > > <vsm:VisualStateManager.VisualStateGroups> > > <vsm:VisualStateGroup x:Name="CommonStates"> > > <vsm:VisualState x:Name="Normal"/> > > <vsm:VisualState x:Name="NormalAlternatingRow"> > > <Storyboard> > > <DoubleAnimation > Storyboard.TargetName="BackgroundRectangle" > Storyboard.TargetProperty="Opacity" Duration="0" To="0"/> > > </Storyboard> > > </vsm:VisualState> > > <vsm:VisualState x:Name="MouseOver"> > > <Storyboard> > > <DoubleAnimation > Storyboard.TargetName="BackgroundRectangle" > Storyboard.TargetProperty="Opacity" Duration="0" To=".5"/> > > </Storyboard> > > </vsm:VisualState> > > <vsm:VisualState x:Name="NormalSelected"> > > <Storyboard> > > <DoubleAnimation > Storyboard.TargetName="BackgroundRectangle" > Storyboard.TargetProperty="Opacity" Duration="0" To="1"/> > > </Storyboard> > > </vsm:VisualState> > > <vsm:VisualState > x:Name="MouseOverSelected"> > > <Storyboard> > > <DoubleAnimation > Storyboard.TargetName="BackgroundRectangle" > Storyboard.TargetProperty="Opacity" Duration="0" To="1"/> > > </Storyboard> > > </vsm:VisualState> > > <vsm:VisualState > x:Name="UnfocusedSelected"> > > <Storyboard> > > <DoubleAnimation > Storyboard.TargetName="BackgroundRectangle" > Storyboard.TargetProperty="Opacity" Duration="0" To="1"/> > > <ColorAnimation Duration="0" > Storyboard.TargetName="BackgroundRectangle" > Storyboard.TargetProperty="(Fill).Color" To="#FFE1E7EC"/> > > </Storyboard> > > </vsm:VisualState> > > </vsm:VisualStateGroup> > > <vsm:VisualStateGroup > x:Name="ValidationStates"> > > <vsm:VisualState x:Name="Valid"/> > > <vsm:VisualState x:Name="Invalid"> > > <Storyboard> > > <ObjectAnimationUsingKeyFrames > Duration="0" Storyboard.TargetName="BackgroundRectangle" > Storyboard.TargetProperty="Visibility"> > > <DiscreteObjectKeyFrame > KeyTime="0" Value="Collapsed"/> > > </ObjectAnimationUsingKeyFrames> > > <DoubleAnimation > Storyboard.TargetName="InvalidVisualElement" > Storyboard.TargetProperty="Opacity" Duration="0" To="1"/> > > </Storyboard> > > </vsm:VisualState> > > </vsm:VisualStateGroup> > > </vsm:VisualStateManager.VisualStateGroups> > > <Grid.RowDefinitions> > > <RowDefinition/> > > <RowDefinition Height="Auto"/> > > <RowDefinition Height="Auto"/> > > </Grid.RowDefinitions> > > <Grid.ColumnDefinitions> > > <ColumnDefinition Width="Auto" /> > > <ColumnDefinition/> > > </Grid.ColumnDefinitions> > > > > <Grid.Resources> > > <Storyboard x:Key="DetailsVisibleTransition"> > > <DoubleAnimation > Storyboard.TargetName="DetailsPresenter" > Storyboard.TargetProperty="ContentHeight" Duration="00:00:0.1" /> > > </Storyboard> > > </Grid.Resources> > > > > <Rectangle x:Name="BackgroundRectangle" > Grid.RowSpan="2" Grid.ColumnSpan="2" Opacity="0" Fill="#FFBADDE9"/> > > <Rectangle x:Name="InvalidVisualElement" > Grid.RowSpan="2" Grid.ColumnSpan="2" Opacity="0" Fill="#FFF7D8DB"/> > > > > <localprimitives:DataGridRowHeader Grid.RowSpan="3" > Name="RowHeader" localprimitives:DataGridFrozenGrid.IsFrozen="True" /> > > <localprimitives:DataGridCellsPresenter > Grid.Column="1" Name="CellsPresenter" > localprimitives:DataGridFrozenGrid.IsFrozen="True" /> > > <localprimitives:DataGridDetailsPresenter > Grid.Row="1" Grid.Column="1" Name="DetailsPresenter" /> > > <Rectangle Grid.Row="2" Grid.Column="1" > Name="BottomGridLine" HorizontalAlignment="Stretch" Height="1" /> > > </localprimitives:DataGridFrozenGrid> > > </ControlTemplate> > > </Setter.Value> > > </Setter> > > </Style> > > > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *Stephen Price > *Sent:* Tuesday, 11 August 2009 6:14 PM > *To:* [email protected] > *Subject:* Re: DataGrid mouseover vsm > > > > Thanks for the reply. I had a look at those and there was no default for > them. ie RowStyle is probably the one I want but it just has the create new > option, no copy. > > > > Will have another look at it later tonight... > > > > cheers, > > Stephen > > On Tue, Aug 11, 2009 at 3:10 PM, Miguel Madero <[email protected]> > wrote: > > Stephen, > > The DG itself doesn't have a MouseOver State. It's template it's a bit > simpler. You can modify the RowHeaderStyle, RowStyle, CellStyle (and > probably others) all of them have the mouse over state, it just depends on > which area of the DG you want to modify. > > > > > On Tue, Aug 11, 2009 at 12:28 AM, Stephen Price <[email protected]> > wrote: > > Hey all, > > > > This is probably simple when you know how, but I'm trying to customise the > mouseover storyboard of a DataGrid. I'm using Blend 2 and have also looked > in Blend 3 but when you create copy for the Edit Template option the copy > has no states. I've also looked in the additional templates menu. Am I > looking in the wrong place or maybe not drilling deep enough into the right > part of the DataGrid? > > Or maybe its a manual thing being a part of the toolkit. The default style > must be coming from somewhere... any ideas? > > > > cheers, > > Stephen > ------------------------------ > > Support procedure: https://www.codify.com/lists/support > List address: [email protected] > Subscribe: [email protected] > Unsubscribe: [email protected] > List FAQ: http://www.codify.com/lists/ozsilverlight > Other lists you might want to join: http://www.codify.com/lists > > > > -- > Miguel A. Madero Reyes > www.miguelmadero.com (blog) > [email protected] > > > ------------------------------ > > Support procedure: https://www.codify.com/lists/support > List address: [email protected] > Subscribe: [email protected] > Unsubscribe: [email protected] > List FAQ: http://www.codify.com/lists/ozsilverlight > Other lists you might want to join: http://www.codify.com/lists > > > ------------------------------ > > Support procedure: https://www.codify.com/lists/support > List address: [email protected] > Subscribe: [email protected] > Unsubscribe: [email protected] > List FAQ: http://www.codify.com/lists/ozsilverlight > Other lists you might want to join: http://www.codify.com/lists > ------------------------------ > Support procedure: https://www.codify.com/lists/support > List address: [email protected] > Subscribe: [email protected] > Unsubscribe: [email protected] > List FAQ: http://www.codify.com/lists/ozsilverlight > Other lists you might want to join: http://www.codify.com/lists > -------------------------------------------------------------------------------- Support procedure: https://www.codify.com/lists/support List address: [email protected] Subscribe: [email protected] Unsubscribe: [email protected] List FAQ: http://www.codify.com/lists/ozsilverlight Other lists you might want to join: http://www.codify.com/lists
