Pageable DataGrid

  • Thread starter Thread starter André Almeida Maldonado
  • Start date Start date
A

André Almeida Maldonado

Hy Guys...

I have a Datagrid with custompaging. This DataGrid is editable, but when I
am on the page 2 and need to edit the first row of the page 2, the datagrid
understand that i am editing the frist row of the first page.. WHY????

See the code:

Private Sub grdNotaProd_EditCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
grdNotaProd.EditCommand

bind2DropDown()

grdNotaProd.EditItemIndex = e.Item.ItemIndex





Thanks....
 
Hi, André Almeida Maldonado,

The ItemIndex is for the current page. You should use:

grdNotaProd.EditItemIndex = (grdNotaProd.CurrentPageIndex *
grdNotaProd.PageSize) + e.Item.ItemIndex

Greetings
Martin
 
Back
Top