Wrox Programmer Forums
|
BOOK: Visual Basic 2005 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2005 Programmer's Reference by Rod Stephens; ISBN: 9780764571985
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2005 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 17th, 2007, 06:24 AM
Authorized User
 
Join Date: Jan 2006
Posts: 43
Thanks: 1
Thanked 0 Times in 0 Posts
Default Top Row in Datagrid

Hi, im again

How can i make a particular row as a TopRow in Datagrid?

Thanks


 
Old March 17th, 2007, 09:38 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

In VB 2005, you should probably be using a DataGridView instead of a DataGrid. It has a FirstDisplayedCell property (and other FirstDisplayedXxx properties) that let you determine which row or cell is currently visible at the top.

In a DataGrid, you might try selecting the desired row by using the SelectedItem or SelectedIndex property.

If you mean that you want to order the items so a particular one is at the top, you can probably reload the data, sorting it in the desired order.


Rod
RodStephens@vb-helper.com

Check out my latest book:
"Expert One-on-One Visual Basic 2005 Design and Development"
http://www.vb-helper.com/one_on_one.htm

Sign up for the free VB Helper Newsletters at http://www.vb-helper.com/newsletter.html
 
Old March 31st, 2007, 02:07 AM
Authorized User
 
Join Date: Jan 2006
Posts: 43
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks, it works

 
Old April 1st, 2007, 11:25 PM
Authorized User
 
Join Date: Jan 2006
Posts: 43
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi, i was unable to change the heading row color, is there any way todo that?

thanks


 
Old April 1st, 2007, 11:27 PM
Authorized User
 
Join Date: Jan 2006
Posts: 43
Thanks: 1
Thanked 0 Times in 0 Posts
Default

and one more in color

if i make the datagridview databound, then i was unable to set the backgroundcolor (by default it goes to white). how to change that.


 
Old April 2nd, 2007, 09:21 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Take a look at these examples:

http://www.vb-helper.com/howto_2005_...iew_cells.html
http://www.vb-helper.com/howto_2005_...w_headers.html
http://www.vb-helper.com/howto_2005_...s_dynamic.html

Rod

Check out my latest book:
"Expert One-on-One Visual Basic 2005 Design and Development"
http://www.vb-helper.com/one_on_one.htm


Rod
RodStephens@vb-helper.com

Check out my latest book:
"Expert One-on-One Visual Basic 2005 Design and Development"
http://www.vb-helper.com/one_on_one.htm

Sign up for the free VB Helper Newsletters at http://www.vb-helper.com/newsletter.html





Similar Threads
Thread Thread Starter Forum Replies Last Post
Scrollbar in row of Datagrid Except Header Row Theone84 ASP.NET 2.0 Professional 0 August 11th, 2008 12:10 AM
datagrid row merge mvenkatesan ASP.NET 1.0 and 1.1 Basics 0 May 1st, 2007 04:23 AM
Manage data row by row in datagrid Dragonist Classic ASP Databases 5 July 29th, 2004 04:17 AM
top row on the screen aspadda Excel VBA 1 December 19th, 2003 03:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.