Solved

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

Posted on 2007-11-26
2
501 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

20 Experts available now in Live!

Get 1:1 Help Now