User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 427,228 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,202 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 279 | Replies: 1
Reply
Join Date: Apr 2008
Posts: 196
Reputation: veledrom is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
veledrom veledrom is offline Offline
Junior Poster

Datagrid focus on 1st row ?

  #1  
Jul 17th, 2008
Hi,

I populate data from database to datagrid but, cursor focuses on last row. How can i make it focused on to first row?

Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,585
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 11
Solved Threads: 235
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Datagrid focus on 1st row ?

  #2  
Jul 17th, 2008
i don't know how to focusing it, but here my binding code (automatically focused on first row) :
  1. Private Sub ViewData()
  2. Set rs = New ADODB.Recordset
  3. rs.CursorType = adOpenDynamic
  4. rs.LockType = adLockOptimistic
  5. rs.Open "select * from Login ", Conn
  6.  
  7. Set DataGrid1.DataSource = rs
  8. DataGrid1.Columns(0).Width = 2000
  9. DataGrid1.Columns(1).Width = 2000
  10.  
  11. DataGrid1.AllowAddNew = False
  12. DataGrid1.AllowArrows = True
  13. DataGrid1.AllowDelete = False
  14. DataGrid1.AllowUpdate = False
  15. End Sub
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 11:38 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC