在项目中使用BriskDataGrid
来源:互联网 发布:windows xp pe 编辑:程序博客网 时间:2024/04/30 04:47
在项目中使用BriskDataGrid
首先必须建立一个Windows应用程序TestBriskDataGrid。
要在这个项目里使用BriskDataGrid控件必须先在项目里添加引用。做法如下:
在工具箱单击“我的用户控件”
在面板上右击,在选择“添加/移除项...”
在“自定义工具箱”对话框的.NET Framework组件单击“浏览...”按钮
选择General.Control.WinForm.dll文件
只勾选BriskDataGrid,把其他两个的对勾去掉
单击“确定”按钮
这时在我的用户控件里BriskDataGrid控件。
把briskDataGrid添加到窗体上,做法和其它控件一样。
接下来要填充数据集,如下:
Imports System
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows ´°ÌåÉè¼ÆÆ÷Éú³ÉµÄ´úÂë "
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
Friend WithEvents BriskDataGrid As General.Control.WinForm.BriskDataGrid
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.BriskDataGrid = New General.Control.WinForm.BriskDataGrid
Me.SuspendLayout()
'
'BriskDataGrid
'
Me.BriskDataGrid.Dock = System.Windows.Forms.DockStyle.Top
Me.BriskDataGrid.Location = New System.Drawing.Point(0, 0)
Me.BriskDataGrid.Name = "BriskDataGrid"
Me.BriskDataGrid.Size = New System.Drawing.Size(292, 232)
Me.BriskDataGrid.TabIndex = 0
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.BriskDataGrid)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private conn As OleDbConnection
Private dsHR As DataSet
Private adptEmployee As OleDbDataAdapter
Private adptDepartment As OleDbDataAdapter
Private Sub FillDataSet()
Dim strConn As String
strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
strConn &= "Data Source = ../hr.mdb"
Me.conn = New OleDbConnection(strConn)
Me.dsHR = New DataSet
Me.adptEmployee = New OleDbDataAdapter("SELECT * FROM employees", Me.conn)
Me.adptDepartment = New OleDbDataAdapter("SELECT * FROM departments", Me.conn)
Me.adptDepartment.Fill(Me.dsHR, "departments")
Me.adptEmployee.Fill(Me.dsHR, "employees")
End Sub
Private Sub InitBriskDataGrid()
Dim dvEmployee As New DataView(Me.dsHR.Tables("employees"))
Me.BriskDataGrid.SetDataBinding(dvEmployee)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.FillDataSet()
Me.InitBriskDataGrid()
End Sub
End Class
运行程序,表employees的数据就显示在数据BriskDataGrid里了。
- 在项目中使用BriskDataGrid
- 在项目中使用NeatUpload
- 在项目中使用 calendar_date_select
- 在项目中使用MailCore
- 在项目中使用CxImage
- 在项目中使用extjs
- 在项目中使用Liquibase
- 在项目中使用Sass
- log4net在项目中使用
- 在项目中使用ExtJS
- icomet在项目中使用
- 在项目中使用volley
- 在项目中使用mybatis
- 在项目中使用springmvc
- 在项目中使用redis
- 在项目中使用swagger
- 在项目中使用Webpack
- BriskDataGrid介绍
- c语言中的类型转换
- 向BriskDataGrid添加DateTimePicker列
- 向BriskDataGrid添加SexBox列
- 向BriskDataGrid添加Text列
- 向BriskDataGrid添加列
- 在项目中使用BriskDataGrid
- 第三十届ACM国际大学生程序设计竞赛全程采访 – 感动中国
- 4月5日的午夜记
- 从下午到晚上,诸多不顺
- 机器无软驱,如何在VMware中安装MINIX ?
- JSP开发入门
- 没有天理,没有人性!
- 2006-04-04 炸弹人游戏开发日志
- 转载:談公平(楊照崑)