Solved

How do I move to a certain row in a datagridview table?

Posted on 2007-11-26
2
500 Views
Last Modified: 2008-02-01
Does anyone know of a way to automatically select a certain row in a datagrid? I have a table with my collection of vintage recordings on and it would be handy for my program to scroll down the table to the last played file and select the relevant row. I have been messing about trying to code something for an hour and I can make the selected row selected, but the control doesn't scroll down (the selected row is hidden off screen and I have to manually scroll down).
0
Comment
Question by:BIGZIPZ1
2 Comments
 
LVL 18

Expert Comment

by:jcoehoorn
ID: 20352440
It's an HTML/web browser problem.  When you select the row all you've done is set a memory flag so you know what's selected and written a slightly different style for the HTML of the relevant row.  But it's still just html and your browser won't scroll down for you.  The only thing you might be able to do is include an anchor and redirect your page to the appropriate # url.
0
 
LVL 8

Accepted Solution

by:
Chumad earned 500 total points
ID: 20352442
I have yet to play with VB 2008, but in 2005, you put something like this in the ASPX page:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="cprReport.aspx.cs" Inherits="cprReport" MaintainScrollPositionOnPostback="true"  %>

Note the maintainScrollPositionOnPostback = true.

good luck :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now