-- 作者:zoomify
-- 发布时间:2012/10/14 7:59:00
--
用了这些代码,把DevExpress.XtraGrid.v10.1 放到了窗体里,但还是和dotnet中的表现有些不一样,如果foxtable能和第三放控件兼容较好,象vb那样,基本就圆满了。下图是vb里的表现(同样的代码)
Dim DBFileName As String = Utils.FilesHelper.FindingFileName("C:\\","aaa.mdb") If DBFileName <> "" Then Dim ds As System.Data.DataSet = New System.Data.DataSet() Dim con As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBFileName Dim tblGrid As String = "表A" Dim oleDbDataAdapter As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM " & tblGrid, con) oleDbDataAdapter.Fill(ds, tblGrid) Dim dvManager As System.Data.DataViewManager = New System.Data.DataViewManager(ds) Dim DV As System.Data.DataView dv = dvManager.CreateDataView(ds.Tables(tblGrid)) Dim gridControl1 As New XtraGrid.GridControl gridControl1.DataSource = dv Dim gridColumn1 As XtraGrid.Columns.GridColumn gridColumn1 =new XtraGrid.Columns.GridColumn gridColumn1.Caption = "第一列" gridColumn1.FieldName = "第一列" gridColumn1.Name = "gridColumn1" gridColumn1.Visible = True gridColumn1.VisibleIndex = 0 \' gridColumn1.Width = 86 Dim gridView1 As XtraGrid.Views.Grid.GridView gridView1 =new XtraGrid.Views.Grid.GridView gridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {gridColumn1}) gridView1.GridControl = gridControl1 gridControl1.MainView = gridView1 gridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {gridView1}) e.Form.panel.controls.add(gridControl1) End If 此主题相关图片如下:捕获.jpg
|