Vb.net 循环浏览Listiview项
我想将lisviewitem中的guid数据传递给名为“GetPaymentLedgerByJobScheduleGUID”的函数,但出现以下错误 listviewsubitem的值类型无法转换为system.guidVb.net 循环浏览Listiview项,vb.net,listview,Vb.net,Listview,我想将lisviewitem中的guid数据传递给名为“GetPaymentLedgerByJobScheduleGUID”的函数,但出现以下错误 listviewsubitem的值类型无法转换为system.guid 有什么想法吗?您需要获取子项的Text属性并对其进行解析 Dim selectedGuidString As String = eachItem.SubItems(7).Text Dim parseGuid As Guid If Guid.TryParse(se
有什么想法吗?您需要获取子项的Text属性并对其进行解析
Dim selectedGuidString As String = eachItem.SubItems(7).Text
Dim parseGuid As Guid
If Guid.TryParse(selectedGuidString, parseGuid) Then
Dim objPaymentLedgerData As PaymentLedgerData = GetPaymentLedgerByJobScheduleGUID(parseGuid)
End If
您是否检查了从每个项目7中获得的信息?我从子项目7中获得了“f92c2457-1455-4db6-8147-301ca8d1ce6b”谢谢Andrew。Guid.TryParse是一种新的TryParse方法吗?根据文档,从4.0开始可用。
Dim selectedGuidString As String = eachItem.SubItems(7).Text
Dim parseGuid As Guid
If Guid.TryParse(selectedGuidString, parseGuid) Then
Dim objPaymentLedgerData As PaymentLedgerData = GetPaymentLedgerByJobScheduleGUID(parseGuid)
End If