问题描述
Hai
我有一个名为Dg的Datagrid,我想以编程方式更改行和列。
我使用此代码
Dg.CurrentCell =新DataGridCellInfo(Dg.Items(IntRow),Dg.Columns(IntCol))
用于设置当前单元格,这样可以正常工作,但所选单元格的蓝色位于同一单元格中。请告诉我如何将这个焦点与当前单元格一起移动。
我不要制作Dg.SelectedCells.Clear(),因为这样只删除选择颜色和没关注。
谢谢
Hai
I have a Datagrid called Dg and I want to programatically change row and column.
I use this code
Dg.CurrentCell = New DataGridCellInfo(Dg.Items(IntRow), Dg.Columns(IntCol))
for setting the current cell and this is working fine but the blue color of selected cell stands in the same cell. Please tell me how to move this focus along with the current cell.
I don't to make Dg.SelectedCells.Clear() as this removes only selection color and not focus.
Thanks
这篇关于如何在wpf gatagrid中设置当前单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!