我在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绑定好的字段及标题都变了。哪里可以设置下,不会发生变化。
|
|