473,385 Members | 1,798 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,385 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 4236
"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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.