收集问题中的焦点控制 [英] Focus control in collection problem

查看:71
本文介绍了收集问题中的焦点控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格,我想在创建新行后聚焦一个单元格

I have a Grid and I want to focus a cell after creating a new row

部分无效的ComentariosAddAndEditNew_Execute()
        {
            this.Comentarios.SelectedItem = Comentarios.AddNew();
            var control = this.FindControlInCollection("Contenido",this.Comentarios.SelectedItem);
            this.Comentarios.SelectedItem.Details.Dispatcher.BeginInvoke(()=> {control.Focus();});

        }

partial void ComentariosAddAndEditNew_Execute()
        {
            this.Comentarios.SelectedItem = Comentarios.AddNew();
            var control = this.FindControlInCollection("Contenido", this.Comentarios.SelectedItem);
            this.Comentarios.SelectedItem.Details.Dispatcher.BeginInvoke(() => { control.Focus(); });

        }

在尝试了几种可能性之后,我有了这段代码..仍然给了我例外.在两次处理之间无效的操作.

I have this code, after trying several possibilities.. still giving me the the exception. Operation not valid between proccess.

Ynx

SebaXOR

推荐答案

Hi Sebaxor

Hi Sebaxor

以下是与您的问题相关的一些讨论话题.希望这些对您有所帮助.

Here are some thread discussed related your issue. Hope these are helpful to you.

关注DataGrid的第三列在新行上

如何订阅在DataGrid中的列上的GotFocus事件

希望获得帮助...

致谢


这篇关于收集问题中的焦点控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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