I didnt realize that in .NET 2.0 you could do this with
MaintainScrollPositionOnPostback="true" in the page declaration.
However, this is not supported in 1.x ( dont know if you are using this )
but if you are one approach that I have used ( and there may be more ).
1.) Add a column to your datagrid
2.) In the ItemDataBount Event ( which fired for each row bound to the
grid ) add the an HTML acnchor tag with the number associated with the row
being added.
If e.Item.ItemType <ListItemType.Footer And e.Item.ItemType <>
ListItemType.Header Then
Dim anchor As New LiteralControl
anchor.Text = "<a name=""" + e.Item.ItemIndex.ToString + """>"
e.Item.Cells(e.Item.Cells.Count - 'YourColumnNumber' ).Controls.Add(anchor)
End If
3.) On Postback when you edit a row, you should intercept the Update event
and call this
bookmarkIndex = e.Item.ItemIndex '// bookmark is a class level integer
InsertScriptBlock
// Sub Further down
Private Sub InsertScriptBlock()
Dim jScript As New System.Text.StringBuilder
jScript.Append("<script language=""JavaScript"">")
jScript.Append("location.href=""#")
jScript.Append(bookmarkIndex.ToString())
jScript.Append(""";")
jScript.Append("</script>")
RegisterClientScriptBlock("Bookmark", jScript.ToString())
End Sub
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@k21g2000cwa.googlegr oups.com...
Thank you very much,
I don't know If we talking the same or I mayed have not got what you
trying to explain to me. But it like this if the user whats to update a
column that is like 50th on the table, he will scroll down get the
column and when he presses edit, the dropdownlist will come properly
but it Scrolls back to the beginning of the table. So the user will
have again have to scroll again down to Be able to update wich is not
what I want. I actually want when the user presses edit the Data grid
should remain intact I mean not to moove. Hope you'll Understand my
problem.
Thank you very much