单击 DataGrid 中的单元格时如何设置状态

发布于 2024-09-26 17:43:09 字数 207 浏览 0 评论 0原文

在开发我的 Silverlight4 SketchFlow 原型时,我有一个包含一列超链接按钮的数据网格。我想在单击这些按钮之一时设置一个状态。数据网格内的控件似乎并未公开以删除其上的行为。有什么办法可以做到这一点吗?本质上,我试图设置一个状态,以便我可以添加一个窗口来显示所选行的详细数据。也许SketchFlow中有更好的方法来解决这个问题?

谢谢!

比尔·坎贝尔

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人间不值得 2024-10-03 17:43:09

我必须查看您的确切 xaml,但我将假设一些事情,最重要的是超链接按钮是由模板生成的。如果是这种情况,则需要在模板中指定行为,而不是直接在数据网格中指定。如果您发布该页面的 xaml,我应该能够为您提供进一步的帮助。

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.

梦亿 2024-10-03 17:43:09

这是我的 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>              

这似乎没有达到我想要的效果。我希望能够单击“超链接”按钮并将“状态”设置为“ShowStops”。

我一直在寻找教程或解释如何执行此操作的内容,但到目前为止还没有任何运气。我还想传递停止 ID(只是一段数据)。

谢谢!
比尔·坎贝尔 (Bill44077)

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文