I have a simple ASPxGridView
which fires a OnCustomButtonCallback
I have tried the following code:
protected void grid_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e)
{
MyGridView.Rows[0].Cell[0].Value;
}
But it does not see Rows
: ASPxGridView does not contain a definition of Rows
I am using DevExpress. Thank you in advance.
P.S. I'd like to get data from the row in which I clicked the custom button on
You can retrieve a particular column/field values using the ASPxGridView.GetRowValues method and pass the related row's VisibleIndex retrieved from the EventArgs e.VisibleIndex property as a parameter:
protected void grid_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) {
var rowValues = grid.GetRowValues(e.VisibleIndex, "FIELD_NAME_HERE");
}