在ListView中检索值“已编辑” [英] Retrieve the value 'edited' in a ListView

查看:60
本文介绍了在ListView中检索值“已编辑”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的救援代码项目 - 再次!大家好问。



我的表格上有一个ListView,其中包含以下栏目:

收到的数量

订购数量

数量已收到

数量优秀



以及其他不适用的地方。



我已将LabelEdit属性设置为True并发生以下事件:



Code Project to my rescue - again! Greetings everyone.

I have a ListView on my form which has the following columns :
Qty to Receive
Qty Ordered
Qty Received
Qty Outstanding

and others which are not applicable here.

I have set the LabelEdit property to True and have the following event :

Private Sub lsv_GRV_DoubleClick(sender As Object, e As System.EventArgs) Handles lsv_GRV.DoubleClick
    lsv_GRV.SelectedItems(0).BeginEdit()
End Sub





这允许用户双击第一列(数量)接收)任何数字行,并输入一个值。



我真正在努力的是检索该值,以便我可以调整收到的数量值和' Qty Outstanding的价值与简单的算术。



我尝试过的所有事件(以及所有这些事件)只返回值在双击之前是在所选项目中(总是为空)。



因此,简而言之,我如何立即检索用户输入的值双击某个项目后。



非常感谢任何帮助。



This allows the user to doubleclick on the first column (Qty to Receive) of any number of rows, and enter a value.

What I am really battling with is retrieving that value so that I can adjust the ''Qty Received'' value and the ''Qty Outstanding'' value with simple arithmetic.

All the events that I have tried (and that''s just about all of them) only return the value that was in the selected item before the double click (which is always null).

Therefore, in a nutshell, how can I immediately retrieve the value that a user has entered after double clicking on an item.

Any assistance would be much appreciated.

推荐答案

使用AfterLabelEdit事件和事件参数e的Label属性。



Use the AfterLabelEdit event and the "Label" property of the event argument "e".

Private Sub ListView1_AfterLabelEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.LabelEditEventArgs) Handles ListView1.AfterLabelEdit
   MsgBox(e.Label)

End Sub


这篇关于在ListView中检索值“已编辑”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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