How to get visible rowindex of aspxgridview on row deleting event

Sheik Syed Mohaideen picture Sheik Syed Mohaideen · Feb 20, 2012 · Viewed 12.1k times · Source

Can anybody help me to get the visible RowIndex of the row on RowDeleting event of ASPxGridView control?

Answer

Niranjan Singh picture Niranjan Singh · Feb 21, 2012

use ASPxGridView.FindVisibleIndexByKeyValue Method at ASPxGridView.RowDeleting Event.. First Specify KeyFieldName in gridcontrol properties.

 protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) 
 {
   int i = ASPxGridView1.FindVisibleIndexByKeyValue(e.Keys[ASPxGridView1.KeyFieldName]);            

 }