views:

681

answers:

1

Hi iam using infragistics ultrawebgrid in this how to get the selected row index in the button click event

+1  A: 

Is the "button click event" the ClickCellButton event or some other Infragistic event that is passing in a CellEventArgs? If so you can grab it directly from that.

private void grid_ClickCellButton(object sender, CellEventArgs e)
{
    int rowIndex = e.Cell.Row.Index;
}

As you can see, once you have the cell object you can move along to the row and even the others cells (via e.Cell.Row.Cells) you want to.

If you are using an event that is passing in RowEventArgs you can do that same thing.

private void grid_AfterRowUpdate(object sender, RowEventArgs e)
{
    int rowIndex = e.Row.Index;
}
auujay