views:

24

answers:

2

Hi,

While working on my Silverlight4 SketchFlow prototype I have a datagrid that has a column of hyperlinkbuttons. I would like to set a State when one of these buttons is clicked. It doesn't appear that the controls inside the datagrid are exposed to drop a behavior on them. Is there any way to do this? Essentially, I am trying to set a State so I can add a window to display detail data from the selected row. Maybe there is a better way to tackle this problem in SketchFlow?

thanks!

Bill Campbell

A: 

I would have to see your exact xaml, but I am going to assume a couple of things, most importantly that the hyperlinkbuttons are produced by a template. If that is the case, the behavior needs to be specified in the template rather than directly in the datagrid. If you post the xaml for the page, I should be able to help you further.

Chuck Hays
A: 

Hi Chuck - here is my xaml

                    <data:DataGridTemplateColumn x:Name="stops" Header="Stop" Width="60" CanUserSort="True" IsReadOnly="True">
                        <data:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <HyperlinkButton x:Name="Stops" Content="{Binding stop, Mode=OneWay}" Style="{StaticResource PageHyperlinkButtonStyle}" HorizontalAlignment="Left" >
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Click">
                                            <pb:ActivateStateAction TargetState="ShowStops"/>
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </HyperlinkButton>
                            </DataTemplate>
                        </data:DataGridTemplateColumn.CellTemplate>
                    </data:DataGridTemplateColumn>              

This doesn't seem to do what I want. I want to be able to click on the Hyperlink button and set the State to ShowStops.

I have been looking for a tutorial or something that explains how to do this but haven't had any luck so far. I'd like to also pass the stop id as well (just a piece of data).

thanks! Bill Campbell (Bill44077)

Bill Campbell
This actually works! It sets the State as I wanted and in my case that state opens a child window with detail data. I don't know if there is some way to tell the child to use detail data for the datagrid row clicked on but since I'm just using sample data it's not so important.
Bill Campbell