C1.Win.C1FlexGrid控件使用

1、数据源

   grd.DataSource = o.tsd.Tables(0)

            grd.Refresh()

2、禁止拖拽

   grd.AllowDragging = C1.Win.C1FlexGrid.AllowDraggingEnum.None
            grd.SelectionMode = C1.Win.C1FlexGrid.Classic.SelModeSettings.flexSelectionByRow

3、数量

   SBar.Panels(1).Text = (grd.Rows - 1).ToString

4、导出文件(页面引用Imports C1.Win.C1FlexGrid)


        With saveExcel
            .Title = "导出" & Me.Text & "信息"
            .FileName = .Title & ".XLS"
            .InitialDirectory = Application.StartupPath
            .Filter = "Excel文件 (*.XLS)|*.XLS|所有类型文件 (*.*)|*.*"
            .RestoreDirectory = True
            If .ShowDialog() = DialogResult.OK Then
                grd.SaveExcel(.FileName, "预警", FileFlags.IncludeFixedCells)
            End If
        End With

5、选择

  For i = 1 To grd.Rows - 1
                If grd(i, 1) = "√" Then
                    bSelect = True
                    Exit For
                End If
            Next

6、某一行某一列

grd(i, 4)

7、双击第一列打钩

  If grd.Col = 1 Then
                If grd(grd.Row, 1) = "√" Then
                    grd(grd.Row, 1) = ""
                Else
                    grd(grd.Row, 1) = "√"
                End If
            End If

你可能感兴趣的:(C1.Win.C1FlexGrid控件使用)