如何将单元格放在Editmode(Datagrid)中 [英] How Can I Place The Cell In Editmode (Datagrid)

查看:100
本文介绍了如何将单元格放在Editmode(Datagrid)中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个包含很多行的数据网格。



当我按下一个按钮时,我想在Datagrid中有一个新行,我想滚动到新行。

Datagrid中的第一个单元格必须放在editmode中。



A have a datagrid with a lot of rows in it.

When I push a button i want a new row in the Datagrid and i want to scrol to the new row.
And the first cell in the Datagrid must be place in editmode.

Private Sub Button_Click_2(sender As Object, e As RoutedEventArgs)
    Dim dr As DataRow
    Dim _index As Integer
    Dim item As Object

    dr = dtGrid.NewRow()
    dr("Status") = 4
    dr("ID") = "0"
    dr("Name") = ""
    dr("CountryId") = "0"
    dtGrid.Rows.Add(dr)

    _index = dtGrid.Rows.IndexOf(dr)

    item = DG.Items(_index)

    DG.SelectedItem = item
    DG.ScrollIntoView(item, DG.Columns(1))

    DG.BeginEdit()
    DG.Focus()

End Sub





我错了什么



What do i Wrong

推荐答案

可能这些链接有帮助y ou:

单击编辑 [ ^ ]

MSDN论坛中的答案 [ ^ ]

WFF数据网格编辑行切换按钮 [ ^ ]

WPF DataGrid实际示例(仅供参考) [ ^ ]



问候
Hi, may be these links helps you:
Single Click Editing[^]
Answer in MSDN Forums[^]
WPF Datagrid Edit Row Toggle Button[^]
WPF DataGrid Practical Examples (Just for some reference)[^]

Regards


这篇关于如何将单元格放在Editmode(Datagrid)中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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