This is a migrated thread and some comments may be shown as answers.

Grid not maintaining position when a row is clicked

2 Answers 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dwayne
Top achievements
Rank 1
Dwayne asked on 20 Nov 2010, 07:08 PM
I have a page with a grid on it the grid is very  tall the grid could extend 2000px or more, it has one column and 10 rows each row is about 300px . When you clik on a button for each row there is a window that pops up. The window pops up fine but the grid jumps back to the top of the page. So i have to scroll back down to the clicked position to view the contenets of the window. Is this the  normal is there anyway to change that  so when i click the button the window just appears and the grid itself does nothing below is the code uses to call the window
<a href="#" onclick="getAddWindow(<%# eval("p_id") %>)" class="CheckUsername" title='<%# eval("p_title") %>'>
                   <%#IIf(Not IsDBNull(Eval("p_video")) And Not Eval("p_video") Is Nothing, "<img src='http://img.youtube.com/vi/" & Eval("p_video") & "/0.jpg' width='150' border='0' />", "")%>
                   <asp:Panel ID="Panel1" runat="server" Visible='<%# showvisible(eval("p_image")) %>'>
                       <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%# convertvarbinary(eval("p_image")) %>'
                           AutoAdjustImageControlSize="false" Height='150px' Width="150px" BorderWidth="0"
                           BorderStyle="none" />
                   </asp:Panel>
               </a>


any help is appreciated thanks.....

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 24 Nov 2010, 03:41 PM
Hello Dwayne,

The problem is not related to RadControls. You need to change

<a href="#" onclick="getAddWindow(....)">

to

<a href="#" onclick="getAddWindow(....);return false;">

Otherwise the browser tries to navigate to a nonexistent bookmark within the web page (with an empty name) and as a result, jumps to the top of the page. This is an anchor to a bookmark:

<a href="#mybookmark">text</a>

Greetings,
Dimo
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Dwayne
Top achievements
Rank 1
answered on 24 Nov 2010, 08:59 PM
Thank you much this was a bit puzzling but i didn't think about it until you pointed it out
Tags
Grid
Asked by
Dwayne
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Dwayne
Top achievements
Rank 1
Share this question
or