Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - Markup Grid Row Background
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Markup Grid Row Background

 Post Reply Post Reply
Author
Message
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: Markup Grid Row Background
    Posted: 20 May 2008 at 10:42pm
I've been trying to figure out a way to change the background colour of an entire grid row using a trigger for IsMouseOver without success. I have a feeling that this might not be possible (because the RowDefinition doesn't support properties such as Background and Style). I've tried different workarounds using the Border element, but the best I've come up with is the ability to change the Background property for a single cell and not an entire row...

Does anyone know if what I am trying to do is possible with the current state of XAML support? Here's the code I am using to change a cell:


<Page xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
   <Page.Resources>
        <Style x:Key='SummaryRow' TargetType="Border">
                <Setter Property="TextBlock.VerticalAlignment" Value="Center"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Trigger.Setters>
                        <Setter Property="Border.Background" Value="#f5f5e0"/>
                    </Trigger.Setters>
                </Trigger>
            </Style.Triggers>
        </Style>
   </Page.Resources>

   <ScrollViewer>
     
        <Grid VerticalAlignment="Center" Margin="14">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150"/>
                <ColumnDefinition Width="150"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>

            <Border Grid.Row="0" Grid.Column="0" Style='{StaticResource SummaryRow}'>
                <TextBlock>Base Contract</TextBlock>
            </Border>
            <Border Grid.Row="0" Grid.Column="1" Style='{StaticResource SummaryRow}'>
                <TextBlock HorizontalAlignment="Right">$5,000,000.00</TextBlock>
            </Border>

            <Border Grid.Row="1" Grid.Column="0" Style='{StaticResource SummaryRow}'>
                <TextBlock>Revised Contract</TextBlock>
            </Border>
            <Border Grid.Row="1" Grid.Column="1" Style='{StaticResource SummaryRow}'>
                <TextBlock HorizontalAlignment="Right">$6,000,000.00</TextBlock>
            </Border>
        </Grid>
 

   </ScrollViewer>
</Page>


I'd like to be able to highlight an entire row (text & amount in the example above) when the mouse is over any cell on a grid row.

Thanks for any advice.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 May 2008 at 1:45am
Hi,
 
sorry, events in ActiveX version of Markup is quite limited - there is no class model now.
 
As workaround instead single Grid you can try StackPanel + Grid in each Row.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.191 seconds.