473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

PostBack!

Hi there! Happy new year.
I'm having this problem with my datagrid, When I scroll to update a
Value, I press edit But it scrolls back itself up. How can I keep it in
one position When I'm Editing? I mean Even when I want t Edit the 100th
Column.

Jan 3 '07 #1
7 1132
I dont have the code to hand, but essentially, you need to create anchor
tags in the html for each row. Use the IDataBound event to create column/row
values ( You will need to add a colum for this ), and in the update event,
you need to create javascript onLoad event to set the locatuion to the
anchor being edited so that when the client page is loaded, it jumps to the
correct place.

Make Sense ?

HTH
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
Hi there! Happy new year.
I'm having this problem with my datagrid, When I scroll to update a
Value, I press edit But it scrolls back itself up. How can I keep it in
one position When I'm Editing? I mean Even when I want t Edit the 100th
Column.

Jan 3 '07 #2
In the page declaration add MaintainScrollPositionOnPostback="true"

--
Ciaran O''''Donnell
http://wannabedeveloper.spaces.live.com
"rcoco" wrote:
Hi there! Happy new year.
I'm having this problem with my datagrid, When I scroll to update a
Value, I press edit But it scrolls back itself up. How can I keep it in
one position When I'm Editing? I mean Even when I want t Edit the 100th
Column.

Jan 3 '07 #3
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

Jan 3 '07 #4
Is this available on 1.x Framework ?
"Ciaran O''''Donnell" <Ci************@discussions.microsoft.comwrote in
message news:FB**********************************@microsof t.com...
In the page declaration add MaintainScrollPositionOnPostback="true"

--
Ciaran O''''Donnell
http://wannabedeveloper.spaces.live.com
"rcoco" wrote:
>Hi there! Happy new year.
I'm having this problem with my datagrid, When I scroll to update a
Value, I press edit But it scrolls back itself up. How can I keep it in
one position When I'm Editing? I mean Even when I want t Edit the 100th
Column.


Jan 3 '07 #5
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

Jan 3 '07 #6
Thanks ,
the page could not be found...

do you have any other Idea?
thank you.

Goofy wrote:
Is this available on 1.x Framework ?
"Ciaran O''''Donnell" <Ci************@discussions.microsoft.comwrote in
message news:FB**********************************@microsof t.com...
In the page declaration add MaintainScrollPositionOnPostback="true"

--
Ciaran O''''Donnell
http://wannabedeveloper.spaces.live.com
"rcoco" wrote:
Hi there! Happy new year.
I'm having this problem with my datagrid, When I scroll to update a
Value, I press edit But it scrolls back itself up. How can I keep it in
one position When I'm Editing? I mean Even when I want t Edit the 100th
Column.

Jan 3 '07 #7
Goofy wrote:
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

In 1.x there is an attribute to the page called 'Smart navigation' which
has been depreciated in 2.0. It didnt work too well and only worked on IE.

Joe (MCAD)
Jan 5 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Matthew Louden | last post by:
I created simple ASP.NET web application to test how AutoPostBack property in a web control works. I set AutoPostBack property to be true of a web control. When I run the application, here's the...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
8
by: walesboy | last post by:
greetings - I have a btnSubmit button with a Handles btnSubmit.click which works great if all the user does is click that button. But, if the user ALSO changes a text box on the page (which...
4
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
2
by: Wizzard | last post by:
I have a repeater with and imagebutton on a page useing VS2005 ASP.Net 2.0 <asp:Repeater ID="Repeater1" runat="server" > <ItemTemplate> <div> <asp:ImageButton ImageUrl="button.gif"...
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
2
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application....
7
by: Tony Girgenti | last post by:
Hello. I'm trying to undetrstand ASP.NET 2.0 and javascript. When i have a button and i click on it and i see the web broswer progress bar at the bottom do something, does that mean that there...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.