C
Chris
I've got a datagrid on my ASP.Net page with paging enabled that allows
users to update data. If users are on, let's say, page 9 and update a
row it ALWAYS kicks them back to page 2 while I'd prefer it to stay on
page 9.
Here's my code:
Private Sub dgInventory_PageIndexChanged(ByVal source As Object,
ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs)
Handles dgInventory.PageIndexChanged
dgInventory.CurrentPageIndex = e.NewPageIndex
BindGrid()
End Sub
----------------------------------------------------------------------------
Private Function BindGrid()
Dim objAsset As New AssetMgmtData
Dim dsDataset As New DataSet
Try
dsDataset =
objAsset.PreRecByCostCenter(cboCostCenter.SelectedItem.Text.ToString())
dgInventory.DataSource = dsDataset
dgInventory.DataBind()
Catch ex As Exception
Response.Write(ex.Message)
Finally
objAsset = Nothing
dsDataset = Nothing
End Try
End Function
users to update data. If users are on, let's say, page 9 and update a
row it ALWAYS kicks them back to page 2 while I'd prefer it to stay on
page 9.
Here's my code:
Private Sub dgInventory_PageIndexChanged(ByVal source As Object,
ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs)
Handles dgInventory.PageIndexChanged
dgInventory.CurrentPageIndex = e.NewPageIndex
BindGrid()
End Sub
----------------------------------------------------------------------------
Private Function BindGrid()
Dim objAsset As New AssetMgmtData
Dim dsDataset As New DataSet
Try
dsDataset =
objAsset.PreRecByCostCenter(cboCostCenter.SelectedItem.Text.ToString())
dgInventory.DataSource = dsDataset
dgInventory.DataBind()
Catch ex As Exception
Response.Write(ex.Message)
Finally
objAsset = Nothing
dsDataset = Nothing
End Try
End Function