PrepareEdit写入: 请教一下,应该怎么改写,放到哪里合适?
If e.IsFocusCell Then
Sele ct Case e.Col.Name
Case "品牌","用途","信号类型","传输方式","分辨率","外观","供电方式","功能","安装方式","特殊应用","安装环境","四级分部"
Dim dr As DataRow = DataTables("材料子类").Find("子目编码 = '" & e.Row("子目编码") & "'")
If dr Is Nothing Then
Return
Else
Dim dr1 As DataRow = DataTables("材料子类").Find("子目编码 = '" & e.Row("子目编码") & "' and 四级分部 = '" & e.Row("四级分部") & "' ")
If dr1 Is Nothing Then
If e.Col.Name ="四级分部" Then '如果正在编辑的是县市列
'从行政区域表提取该省市的县市作为列表项目
e.Col.Combolist = DataTables("材料子类").GetComboListString("四级分部", "[子目编码] = '" & e.Row("子目编码") & "'")
End If
'If MessageBox.show("'四级分部'列可设置,是否设置?","提示!",MessageBoxButtons.YesNo)=DialogResult.Yes Then
''e.Table.Select(e.Row.Index,e.Table.Cols("四级分部").Index)
'Else
Return
'End If
Else
Dim strs() As String = {"品牌","用途","信号类型","传输方式","分辨率","外观","供电方式","功能","安装方式","安装环境","特殊应用"}
For Each str As String In strs
If e.Col.Name = str Then '如果正在编辑的是县市列
'从行政区域表提取该省市的县市作为列表项目
e.Col.Combolist = DataTables("材料子类").GetComboListString(str, "[子目编码] = '" & e.Row("子目编码") & "' and [四级分部] = '" & e.Row("四级分部") & "'")
End If
Next
End If
End If
End Sel ect
End If