【发布时间】:2012-02-20 10:22:03
【问题描述】:
谁能帮我在RowDeleting事件ASPxGridView控件上获得可见的RowIndex行?
【问题讨论】:
标签: asp.net devexpress aspxgridview
谁能帮我在RowDeleting事件ASPxGridView控件上获得可见的RowIndex行?
【问题讨论】:
标签: asp.net devexpress aspxgridview
使用ASPxGridView.FindVisibleIndexByKeyValue MethodASPxGridView.RowDeleting Event.. 首先在gridcontrol属性中指定KeyFieldName。
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
{
int i = ASPxGridView1.FindVisibleIndexByKeyValue(e.Keys[ASPxGridView1.KeyFieldName]);
}
【讨论】:
处理 ASPxGridView.RowDeleting 事件;
通过e.Keys[ASPxGridView.KeyFieldName]字典确定已处理行的键;
通过 ASPxGridView.FindVisibleIndexByKeyValue 方法确定行的可见索引。
【讨论】:
你也可以像这样使用 rowdeleting 事件中的变量 e
e.visibleIndex
例子:
With aspxgrid.getDataRow(e.visibleindex)
'Here you can use your code
End With
【讨论】: