DataGrid 、DataList、Repeater PK
数据访问控件的区别
1.功能从弱到强依次为Repeater->DataList->DataGrid
2.功能明细
...............Repeater....................................................................->
能够绑定显示基本的数据,方便使用,灵活,自主选择性大
...............DataList:.....................................................................->
除了Repeater的功能之外,还有编辑,查询的功能
....................DataGrid......................................................................->
有 BoundColumn,HyperLinkColumn,ButtonColumn(事件为OnItemCommand,ButtonType属性可设 置为pushButton成为标准Button按钮),EditCommandColumn,TemplateColumn(下面有 ItemTemplate,HeaderTemplate,FooterTemplate等等)
有分页,排序,编辑,查询功能等
EditCommandColumn属性里设置EditText,CancelText,UpdateText,ButtonType等属性,
然后绑定列,DataGrid里设置响应事件OnEditCommand,OnCancelCommand,OnUpdateCommand,编写事件响应函数代码