473,322 Members | 1,379 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,322 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 4226
"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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.