- 2
- 0
- 约1.53万字
- 约 15页
- 2016-12-06 发布于重庆
- 举报
Ext20Grid使用手冊
ExtGrid 2.0控件使用手册
如何使用ExtGrid控件?---- 完整示例讲解
1.1、显示数据
1.1.1 aspx代码,指定控件高度和宽度
cc2:ExtGrid ID=extStudent runat=server Height=300px Width=960px/
1.1.2 加载数据,并指定列的编辑器(可用编辑器参考表格[可用编辑器类型])
Get the data source what you want to bind to the ExtGrid
Dim dt As DataTable = DALExtGrid.GetStudents().Tables(0)
Get the data source what you want to bind to the ComboBox of the Country column
Dim dtCountry As DataTable = DALExtGrid.GetCountryCodeAndName().Tables(0)
Get the data source what you want to bind to the ComboBox of the City column
Dim dtCity As DataTable = DALExtGrid.GetCityCodeAndName().Tables(0)
Get the data source what you want to bind to the ComboBox of the Sex column
Dim dtSex As DataTable = Me.InitColDataTable()
Set The ExtGrids data source
Me.extStudent.DataSource = dt
Add all of the columns you want to show to client in Ext Grid.
Me.extStudent.Columns.Add(Student Name, Name, 160, _
New ExtGrid.ExtEditor.TextField())
Me.extStudent.Columns.Add(Sex, Sex, 60, _
New ExtGrid.ExtEditor.ComboBox(code, _
name, Me.InitColDataTable()))
Me.extStudent.Columns.Add(Seat No., SeatNo, 60, _
New ExtGrid.ExtEditor.NumberField(seatNo, False))
Me.extStudent.Columns.Add(Country, Country, 120, _
New ExtGrid.ExtEditor.ComboBox(Country, CountryCode, _
CountryName, dtCountry))
Me.extStudent.Columns.Add(City, City, 120, _
New ExtGrid.ExtEditor.ComboBox(City, CityCode, CityName, dtCity))
Me.extStudent.Columns.Add(E-mail, Email, 180, _
New ExtGrid.ExtEditor.TextField())
Me.extStudent.Columns.Add(Born Date, BornDate, _
120, ExtColumnAlignType.Left, _
New ExtGrid.ExtEditor.DateField(bornDate, d-M-Y), renderDate)
Me.extStudent.Columns.Add(Mark, Mark, 60, _
New ExtGrid.ExtEditor.NumberField())
Me.extStudent.Columns.Add(Is Active, Active, 60,
ExtColumnAlignType.Center, _New ExtGrid.ExtEditor.CheckBox(), renderBoolean)
1.1.3、页面效果图
1.2、添加新记录,并设置默认值
1.4.1、点击New Line按扭时添加新记录
onclick=extStudent.addRow();
1.4.2、指定设置默认值的方法
cc2:ExtGrid ID=extStudent runat=server H
原创力文档

文档评论(0)