ListView.Items.refresh()和焦点出现问题 [英] Problem with ListView.Items.refresh() and focus

查看:88
本文介绍了ListView.Items.refresh()和焦点出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

抱歉我的英语.我建立了一个自定义的ListView.我想要一个自动行为来在ItemSelected是最后一个项目时添加新行,为此行为我创建了新实体并调用

Hi, sorry for my english. I buid a custom ListView. I want a behaviour automatic for add new row when the ItemSelected is the last item, for this behaviour I create new entity and call

ListView.Items.refresh()

ListView.Items.refresh()

好的,但是在执行此命令后,我失去了焦点!焦点移到listview,如果我按下键选项卡wpf选择第一个ListViewItem!如果可能的话,我想在命令ListView.Items.refresh()之后自动选择最后一个ListViewItem

all right but after this command I lost focus! the focus move to listview and if I pressed key tab wpf selected first ListViewItem!! if possible I want after command ListView.Items.refresh() selected last ListViewItem in automatic

谢谢

推荐答案

您好,


您可能已经引用了新的ListViewItem,让我们说newlistviewitem =>

listview.Items.Add(newlistviewitems);
listview.SelectedItem = newlistviewitem;
listview.Focus();


Hi,


You probably have a reference to the new ListViewItem, let's say newlistviewitem =>

listview.Items.Add(newlistviewitems);
listview.SelectedItem = newlistviewitem;
listview.Focus();


代码段


这篇关于ListView.Items.refresh()和焦点出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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