473,404 Members | 2,137 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,404 software developers and data experts.

SmartNavigation

Rob
Hello,

I have a <DIV> in my Datagrid which produces scrollbars
when it is populated. When I click the Edit button in the
edit comand column I need to be able to maintain the
scroll position. According to MSDN, setting
SmartNavigation="True" in the @Page directive will achieve
this but unfortunately it does not, does anybody know how
to do this? I have found an article explaining how to do
this with c# (by creating a Inet Explorer behaviour) but I
am using vb and want to keep it as simple as possible if I
can?

Cheers

Rob
Nov 18 '05 #1
2 4238
"Rob" <an*******@discussions.microsoft.com> wrote in message news:<00****************************@phx.gbl>...
Hello,

I have a <DIV> in my Datagrid which produces scrollbars
when it is populated. When I click the Edit button in the
edit comand column I need to be able to maintain the
scroll position. According to MSDN, setting
SmartNavigation="True" in the @Page directive will achieve
this but unfortunately it does not, does anybody know how
to do this? I have found an article explaining how to do
this with c# (by creating a Inet Explorer behaviour) but I
am using vb and want to keep it as simple as possible if I
can?

Cheers

Rob


http://www.strengthtechnologies.com/.../Download.aspx

I think this will do what you want. it is very simple to use. download
it to yu bin directory.
put
<%@ Register TagPrefix="cc1" Namespace="StrengthControls.Scrolling"
Assembly="StrengthControls.Scrolling" %>

at the top of your aspx, and

<cc1:SmartScroller id="SmartScroller1" runat="server" />

somwhere in the <body> of your document.
bob==uncle

Smartnavigation = evil imho, only "works" on ie browser, and seems to
create more hassles than its worth. set to "false"!

fragg
Nov 18 '05 #2
"Rob" <an*******@discussions.microsoft.com> wrote in message news:<00****************************@phx.gbl>...
Hello,

I have a <DIV> in my Datagrid which produces scrollbars
when it is populated. When I click the Edit button in the
edit comand column I need to be able to maintain the
scroll position. According to MSDN, setting
SmartNavigation="True" in the @Page directive will achieve
this but unfortunately it does not, does anybody know how
to do this? I have found an article explaining how to do
this with c# (by creating a Inet Explorer behaviour) but I
am using vb and want to keep it as simple as possible if I
can?

Cheers

Rob


Hi Rob, not sure smartnav works well with grids, i doubt itll keep
position within DIV, it only keeps scroll position on the main scroll
bar.

Anyway , we did the following to keep edit position on the edit
selected with a DIV:

add the follwing to the main class variables of the form:
private int itemCount = 0;

In the ItemDataBound event of your grid add the following code to add
a number bookmark to each row in the grid that is created:
//************ItemDataBound************************* *
// placing a bookmark against the first column
LiteralControl anchor = new LiteralControl();
anchor.Text = "<a name=\"" + itemCount.ToString() + "\">";
itemCount ++;
e.Item.Cells[0].Controls.Add(anchor);
//************ItemDataBound************************* *

Then in the EditCommand event method add the following code to get the
browser to jump to the item when the page reloads:
//*************EditCommand **************************
System.Text.StringBuilder jScript = new System.Text.StringBuilder();
jScript.Append("<script language=\"JavaScript\">");
jScript.Append("location.href=\"#");
jScript.Append(e.Item.ItemIndex.ToString());
jScript.Append("\";");
jScript.Append("</script>");

this.RegisterClientScriptBlock("Bookmark", jScript.ToString());
//************EditCommand *************************

You may then want to add the above edit commmand code into any method
that ou want to retain position, e.g. UpdateCommand and CancelCommand.
We put the above code into a function and passed in the ItemIndex from
whatever event function was called (SelectCommand, EditCommmand,
UpdateCOmmand, CancelCommand

Hope that helps.

Ryan Harvey, IBM
Nov 18 '05 #3

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

Similar topics

0
by: karim | last post by:
I have a datalist with an itemedittemplate. When I have smartnavigation on, I can't exit out from edit mode with EditItemIndex = -1. When smartnavigation is off, everything works fine. I know...
1
by: Jerad Rose | last post by:
I've done some investigating about various problems with the SmartNavigation feature. It seems to me that the general consensus is to avoid SmartNavigation like the plague. It's really a shame...
4
by: Chris Ruegsegger | last post by:
I have a registration type page that asks a series of questions but does so using Panels to display only a couple at a time. I have a Next and Back button on each panel for navigation purposes. ...
2
by: Snig | last post by:
Hi All I wanted to enable "SmartNavigation" in my site. For this I put <pages smartNavigation="true" /> in web.config file. So far so good. But it causes the link from the aspx pages to the css...
2
by: SLE | last post by:
A web user control exposes a RadioButtonList (with AutoPostBack = true) called "Question". This control also has an embedded RequiredFieldValidator control. 1. Main ASPX page is populated with...
4
by: Dagong Wang | last post by:
Hi, I have an ASP.NET application that works fine in my testing server. However, when I uploaded it into a hosting server, page SmartNavigation option and server side redirection, such as...
4
by: Bobby | last post by:
Hi all... I rather confuse using smartnavigation in my web application because if I set the "smartnavigation = true" then If I run my app, then after I post page that page, using event...
3
by: Nestus | last post by:
Hi, im developing a solution in ASP.Net, i have a page that i need to use the smartnavigation in true, the problem occurs when i put in the directive @Page SmartNavigation = true my page trhows a...
2
by: Wysiwyg | last post by:
Has anyone found a reasonable way to emulate smartnavigation functionality for any browser? I'd really like to avoid creating history entries when posting back to the same page. SmartNavigation...
5
by: Mogens Nielsen - Elbek & Vejrup A/S | last post by:
Hi, I can see from the msdn-docs that SmartNavigation is now obsolete. Why is that? The SmartNavigation feature has been replaced by MaintainScrollPosition, but the scoll position is not why...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.