可以尝试在Load事件中将Value为Nothing的都设置为""
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Dim cbct As FarPoint.Win.Spread.CellType.ComboBoxCellType
- cbct = New FarPoint.Win.Spread.CellType.ComboBoxCellType()
- cbct.Items = New String() {"AA", "BB", "CC", "DD"}
- FpSpread1.ActiveSheet.Columns(0).CellType = cbct
- FpSpread1.ActiveSheet.RowCount = 10
- FpSpread1.ActiveSheet.Cells(0, 0).Value = "BB"
- For index As Integer = 0 To FpSpread1.ActiveSheet.RowCount - 1
- If FpSpread1.ActiveSheet.Cells(index, 0).Value Is Nothing Then
- FpSpread1.ActiveSheet.Cells(index, 0).Value = ""
- End If
- Next
- End Sub
复制代码 |