Solved

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

Posted on 2007-11-26
2
504 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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