如何在数据网格的最后一行设置fucos [英] how to set fucos on last row of datagrid

查看:107
本文介绍了如何在数据网格的最后一行设置fucos的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将焦点放在数据网格的最后一行.


我们可以选择datagrid的最后一行.

DG.SelectedIndex = DG.Items.Count-1;

但重点不在那一行.

需要您的支持.

how to set focus on last row in a data grid.


we can select last row of datagrid.

DG.SelectedIndex= DG.Items.Count-1;

but focus does''t go on that row.

Need your kind Support.

推荐答案

通常,我将网格绑定到实施ICollectionView [ CurrentItem [CurrentPosition [ BindingListCollectionView [ListCollectionView [ ItemCollection [ ^ ]

构建视图模型时-将集合显示为BindingListCollectionView或ListCollectionView-而不显示为List< t>或BindingList< t>.这样可以确保您可以绑定集合的当前"元素-在视图模型中有意义.

最好的问候
Espen Harlinn
Usually I bind the grid to an object that implments ICollectionView[^]

This interface has a CurrentItem[^] and a CurrentPosition[^] property.

.Net provides BindingListCollectionView[^], ListCollectionView[^] and ItemCollection[^]

When you build your view model - expose collections as BindingListCollectionView or ListCollectionView - not as List<t> or BindingList<t>. This ensures that you can bind the "Current" element of a collection - something that makes sense in a view model.

Best regards
Espen Harlinn


这篇关于如何在数据网格的最后一行设置fucos的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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