vb.net - 类型 GridViewRow 未定义 vb.net
问题描述
我想对 datagridview 列进行分组,所以我找到了这段代码,但它给了我错误:
“未定义类型 GridViewRow”
那里有什么问题?
Protected Sub OnDataBound(sender As Object, e As EventArgs)
For i As Integer = SearchInvoiceDGV.Rows.Count - 1 To 1 Step -1
Dim row As GridViewRow = SearchInvoiceDGV.Rows(i)
Dim previousRow As GridViewRow = SearchInvoiceDGV.Rows(i - 1)
For j As Integer = 0 To row.Cells.Count - 1
If row.Cells(j).Text = previousRow.Cells(j).Text Then
If previousRow.Cells(j).RowSpan = 0 Then
If row.Cells(j).RowSpan = 0 Then
previousRow.Cells(j).RowSpan += 2
Else
previousRow.Cells(j).RowSpan = row.Cells(j).RowSpan + 1
End If
row.Cells(j).Visible = False
End If
End If
Next
Next
End Sub
解决方案
推荐阅读
- mysql - 'method' 对象在 username = (request.POST.get['username']) 中不可下标
- swiftui - Swiftui如何根据textview内容管理Scrollview Height
- java - Spring Boot (Reactive) - bootJar 与服务提供者接口 (SPI)
- python - Python中使用DataFrame的线性回归预测模型
- python - 将 df.groupby() 形成的组拆分为具有这些分组值的多个数据帧
- regex - Kibana 查询语言 - 在字段中查找数字
- node.js - 从 FFMPEG 生成的 Mp4 文件无法在快速播放器上修剪
- ios - 如何在真实的 iOS 设备上运行 sonarQube?
- android - 如何在 android 中获取特定的用户订阅详细信息
- react-native - 反应本机 ld:找不到 -lswiftWebKit 的库