Lightswitch HTML - 从弹出对话框中获取焦点时,选择表格控件或列表中的第一项 [英] Lightswitch HTML - select the first item in a table control or list, on getting focus back from a popup dialog

查看:60
本文介绍了Lightswitch HTML - 从弹出对话框中获取焦点时,选择表格控件或列表中的第一项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有表格控件的浏览屏幕,并选择了一个项目。然后我使用内置命令按钮从我的浏览屏幕打开一个弹出窗口(即不是用户定义的命令按钮 - 所以我没有执行/可以执行事件)。当弹出窗口关闭时,
我的浏览屏幕会重新获得焦点,但表格不再有选定的项目。


有没有办法自动选择表格中的项目当弹出窗口关闭后,浏览屏幕会重新聚焦吗?


基本上,我正在寻找一个"屏幕得到关注"的屏幕。或"屏幕重新激活"或"屏幕重新激活"。一种事件,我可以从中以编程方式选择表格中的第一项。有没有办法实现这个?




解决方案

我有一个类似的问题,结果相同。如果我关闭屏幕(列表和详细信息)并重新打开它,则所选项目为空。我试图通过以下代码在屏幕的_created方法和_activated方法中强制选择项目。

如果Me.Suppliers.SelectedItem是Nothing然后
Me.Suppliers.SelectedItem = Me.Suppliers.FirstOrDefault
结束如果

我在.selecteditem中添加了一个监视,看它确实从' ;没什么" to"{LightSwitchApplication.Supplier}"然后回来"没什么"屏幕显示完成后再次显示。


打开应用程序并首次显示屏幕时,所选项目的数据将根据需要显示。



I have a browse screen with a table control, with an item selected. I then open a popup from my browse screen using built in command button(i.e. not a user defined command button - so I have no execute/can execute events). When the popup is closed, my browse screen gets focus back, but the table no longer has a selected item.

Is there a way to automatically select an item in the table when the browse screen gets focus back after the popup has been closed?

Basically, I'm looking for a "screen got focus" or "screen re-activated" sort of event, from which I can programmatically select the first item in my table. Is there a way to implement this?


解决方案

I have a similar issue with the same result. If I close a screen (list and details) and re open it, the selected item is nothing. I tried to force the selected item via the following code in both the _created method and the _activated method of the screen.

            If Me.Suppliers.SelectedItem Is Nothing Then
                Me.Suppliers.SelectedItem = Me.Suppliers.FirstOrDefault
            End If

I added a watch to the .selecteditem to see that it does change from "Nothing" to "{LightSwitchApplication.Supplier}" and back "Nothing" again after the screen has finished displaying.

Upon opening the appication and displaying the screen for the first time the data for selected item is displayed as desired.


这篇关于Lightswitch HTML - 从弹出对话框中获取焦点时,选择表格控件或列表中的第一项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆