找回密码
 立即注册

QQ登录

只需一步,快速开始

chenfeng1029
金牌服务用户   /  发表于:2017-4-5 17:36  /   查看:3037  /  回复:3
我在c1flexgrid已经设置绑定的字段及字段标题。
但是我通过下列语句后,发现会更改绑定的表格标题。
代码如下:
  Dim dt As New DataTable
        Dim nTsession As New Domino.NotesSession
        Dim nTdb As NotesDatabase
        Dim ntView As NotesView
        Dim nTCol As NotesDocumentCollection
        Dim nTdoc As NotesDocument
        Dim intsuc As Integer
        intsuc = 0
        '//dt初始化,设置字段

        dt.Columns.Add("FldNameLK")
        dt.Columns.Add("FldFullNameLK")
        dt.Columns.Add("FldEmailLK")
        dt.Columns.Add("SysFullCodeLK")
        dt.Columns.Add("FldCompanyLK")
        dt.Clear()

        Try
            nTsession.Initialize()
            nTdb = nTsession.GetDatabase("www/johnshen", "linkeroa\Organization.nsf")
            If nTdb.IsOpen = False Then
                ErrInfo = "无法打开Notes人员组织库,请联系管理员"
                MsgBox(ErrInfo)
                Exit Function
            End If
            ntView = nTdb.GetView("($ViewPersonConfig_NotesLK_Name)")
            nTCol = ntView.GetAllDocumentsByKey(vSchText, False)
            nTdoc = nTCol.GetFirstDocument()
            Dim dr As DataRow
            While Not nTdoc Is Nothing
                '//添加到数据集中
                '//dt新建行
                dr = dt.NewRow()
                dr("FldNameLK") = nTdoc.GetItemValue("FldNameLK")(0)
                dr("FldFullNameLK") = nTdoc.GetItemValue("FldFullName")(0)
                dr("FldEmailLK") = nTdoc.GetItemValue("FldEmailLK")(0)
                dr("SysFullCodeLK") = nTdoc.GetItemValue("SysFullCodeLK")(0)
                dr("FldCompanyLK") = nTdoc.GetItemValue("FldCompanyLK")(0)
                dt.Rows.Add(dr)
                nTdoc = nTCol.GetNextDocument(nTdoc)
            End While
            DtReturnDataValue = dt.Clone() '//复制表结构
            With C1Flexgrid
                .DataSource = dt
            End With


我只是把需要的数据加载到一个datatable,然后绑定,结果事先设置好的c1flexgrid绑定好的字段及标题都变了。哪里可以设置下,不会发生变化。

3 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2017-4-6 11:50:17
沙发
不好意思回复晚了。
默认是会按照数据源生成列。
如果想要自定义,请设置AutoGenerateColumns为false。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
chenfeng1029
金牌服务用户   /  发表于:2017-4-6 23:14:21
板凳
谢谢。
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2017-4-7 09:28:25
地板

不用客气
辛苦了。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部