posts - 10, comments - 3, trackbacks - 0, articles - 0

Component One控件使用心得

Posted on 2007-09-11 12:50 石头 阅读(4897) 评论(3)  编辑 收藏 引用 所属分类: .NET技术

Component One控件中的flexgrid控件,相信好多人都使用过吧,其功能不用多说了,主要是比.net中的datagrid控件使用起来方便,可以满足目前绝大数需要。
1 比如遍历表格,高亮显示符合条件的单元格,行,列等
        Dim cs As C1.Win.C1FlexGrid.CellStyle = flexGrid.Styles.Add("Critical")
        cs.BackColor = Drawing.Color.Bisque

        For col As Integer = flexGrid.Cols.Fixed To flexGrid.Cols.Count - 1
            If flexGrid.Cols(col).AllowEditing = False Then
                flexGrid.Cols(col).Style = cs
            End If
        Next
2  导出文件
   可以很方便的导出到excel等
    Dim File As New SaveFileDialog
    Dim filename As String
    File.Filter = "xls files (*.xls)|*.xls|All files (*.*)|*.*"

    If File.ShowDialog = DialogResult.OK Then
            If File.FileName.Trim().Length > 0 Then
                filename = File.FileName.Trim()
                File.OverwritePrompt = True
                If _flex.Cols.Contains("Check") Then
                    _flex.Cols.Remove("Check")
                End If

                _flex.SaveGrid(filename, C1.Win.C1FlexGrid.FileFormatEnum.Excel,C1.Win.C1FlexGrid.FileFlags.IncludeFixedCells)
                MessageBox.Show("导出文件成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Else
                MessageBox.Show("请输入保存文件名称!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information)
            End If
还有好多常用功能,在这就不罗列了,有使用此控件的朋友,可以一起交流

Feedback

# re: Component One控件使用心得  回复  更多评论   

2008-07-08 16:11 by coolfall@21cn.com
问一下,怎么让合并过的表头导出后在excel文件中也是合并的?用IncludeMergedRanges枚举没用。谢谢。

# re: Component One控件使用心得  回复  更多评论   

2008-10-22 12:28 by Archicheung
请问,在程序中使用componentOne后,怎么把自己的程序部署到目标机器上,实现目标机器不安装componentOne,也能运行我写的程序?
只有注册用户登录后才能发表评论。