教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 互联网资料 >

AspxGridView控件帮助文档(10)

来源:网络收集 时间:2026-08-26
导读: 3.AutoFilterCellEditorInitialize (1)语法: public delegatevoid ASPxGridViewEditorEventHandler(object sender,ASPxGridViewEditorEventArgse); ASPxGridViewEditorEventArgs类包括以下属性: Column:GridView

3.AutoFilterCellEditorInitialize (1)语法:

public delegatevoid ASPxGridViewEditorEventHandler(object sender,ASPxGridViewEditorEventArgse);

ASPxGridViewEditorEventArgs类包括以下属性:

Column:GridViewDataColumn类型,只读。栏位实例。 Editor:ASPxEditBase类型,只读。编辑器实例。 KeyValue:object类型。只读。关键栏位值。 Value:object类型。只读。过滤栏位值。 VisibleIndex:int类型。只读。行号。

(2)英文说明:

Enables the cell editors displayed within theauto filter row cells to be initialized.

(3)触发条件:必须显示了自动过滤工具条 要显示自动过滤行应该做如下设置:

this.ASPxGridView1.Settings.ShowFilterBar= DevExpress.Web.ASPxGridView.GridViewStatusBarMode.Visible;//显示自动过滤工具条

this.ASPxGridView1.Settings.ShowFilterRow= true;//显示自动过滤行

(4)中文说明:允许程序员为过滤行栏位指定显示格式。

该事件是在AutoFilterCellEditorCreate事件后执行的,可以在此事件中覆盖AutoFilterCellEditorCreate事件中所指定的属性。 例:

switch (e.Column.FieldName) {

case\

e.Editor.BackColor = System.Drawing.Color.Yellow; break; default: break; }

4.BeforeGetCallbackResult

(1)语法:public delegate void EventHandler(object sender, EventArgse);

(2)英文说明:

Occurs after a callback, when the ASPxGridView is loaded,but prior to rendering.

(3)触发条件:调用AspxGridView客户端方法GetValuesOnCustomCallback。

(4)中文说明:发生在ASPxGridView已装载但未呈现时获取回调结果。

5.BeforePerformDataSelect

(1)语法:publicdelegate void EventHandler(object sender, EventArgs e);

(2)英文说明:Occursbefore the ASPxGridView control obtains data from a data source. (3)触发条件:绑定数据时。

(4)中文说明:发生在ASPxGridView从数据源中获取数据之前。 通常在主从模式下用于给明细AspxGridView的数据检索参数赋值。 例:

Session[\//Session[\为明细AspxGridView的数据源参数

6.CancelRowEditing

(1)语法:public delegatevoid ASPxStartRowEditingEventHandler(object sender, ASPxStartRowEditingEventArgse);

ASPxStartRowEditingEventArgs类包括以下属性: Cancel:bool类型。可读写。

(2)英文说明:Enables you to preventchanges made within a row from being discarded. (3)触发条件:用户点击内置的【取消】按钮或调用CancelEdit()方法时。 (4)中文说明:取消行编辑状态前事件。

可以在该事件中阻止用户将编辑状态转换为浏览状态。(设置e.Cancel=true)例如弹出对话框提醒用户是否确实需要取消编辑状态或清除在编辑过程中缓存的数据。

7. CellEditorInitialize

(1)语法:publicdelegate void ASPxGridViewEditorEventHandler(object sender, ASPxGridViewEditorEventArgse);

ASPxGridViewEditorEventArgs类包括以下属性:

Column:GridViewDataColumn类型,只读。栏位实例。 Editor:ASPxEditBase类型,只读。编辑器实例。 KeyValue:object类型。只读。主键栏位值。 Value:object类型。只读。过滤栏位值。 VisibleIndex:int类型。只读。行号。

(2)英文说明:Enables the cell editorsdisplayed within the edit cells to be initialized. (3)触发条件:发生在行数据状态由浏览状态改为编辑状态时。 (4)中文说明:栏位编辑器初始化事件。

8. ClientLayout (1)语法:

publicdelegate void ASPxClientLayoutHandler(object sender,ASPxClientLayoutArgse);

ASPxClientLayoutArgs类包括以下属性:

LayoutData:string类型,可读写。布局数据。

LayoutMode:ClientLayoutMode类型(枚举)。只读。布局模式。取值范围:Loading、Saving.

(2)英文说明:

Enables you to save and restore the previously savedlayout of the ASPxGridView. (3)触发条件:在调用SaveLayout()保存布局或LoadLayout()装载布局时触发该事件。 (4)中文说明:允许你保存布局或装载之前的布局。

9. CustomButtonCallback (1)语法:

publicdelegate void ASPxGridViewCustomButtonCallbackEventHandler( objectsender,ASPxGridViewCustomButtonCallbackEventArgs e);

ASPxGridViewCustomButtonCallbackEventArgs类包括以下属性: ButtonID:string类型,只读。按钮名称。 VisibleIndex: int类型。只读。行号。

(2)英文说明:Occurs when a custom command button has been clicked. (3)触发条件:点击自定义按钮时触发。 (4)中文说明:该事件不能只在页面IsPostBack=false的情况下声明,否则无法触发。 自定义按钮可以在标签中定义。 例:

通常在该事件中捕获按钮名称调用对应方法作出实际的回应。 例:

string id = e.ButtonID; switch (id) {

case\

this.ASPxGridView1.Selection.SelectRow(e.VisibleIndex); break; default: break; }

10. CustomCallback

(1)语法:

publicdelegate void ASPxGridViewCustomCallbackEventHandler(object sender,ASPxGridViewCustomCallbackEventArgs e);

ASPxGridViewCustomCallbackEventArgs类包括以下属性: Parameters:string类型,只读。所有自定义参数值。 (2)英文说明:

Fires when a round tripto the server has been initiated by a call to the clientASPxClientGridView.PerformCallback method.

(3)触发条件:调用客户端PerformCallback方法时触发。 (4)中文说明:该事件不能只在页面IsPostBack=false的情况下声明,否则无法触发。事件参数ASPxGridViewCustomCallbackEventArgs.Parameters由程序员负责解释。

例: //自定义回调事件

protected void ASPxGridView1_CustomCallback(object sender,ASPxGridViewCustomCallbackEventArgs e) {

if(e.Parameters.Length > 0) {

intvisibleIndex = 0;

string[]parameterList = e.Parameters.Split('|');//取参数列表 if(parameterList.Length > 0) {

switch(parameterList[0].ToString().ToLower()) {

case\新增

this.ASPxGridView1.AddNewRow(); break;

case\修改 if(parameterList.Length >= 2) {

if (Int32.TryParse(parameterList[1], out visibleIndex)) {

this.ASPxGridView1.StartEdit(visibleIndex); } } break; default: break; } }? } }

前台代码示例:

Grid.PerformCallback('AddNewRow') Grid.PerformCallback('Start …… 此处隐藏:3697字,全部文档内容请下载后查看。喜欢就下载吧 ……

AspxGridView控件帮助文档(10).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/444171.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)