Solved

Locking an entire row of True DBGrid

Posted on 2004-04-01
4
3,064 Views
Last Modified: 2008-04-03
Hi experts,

Can someone tell me how to lock the current row according to the value of a field in that row ?

I am using VB6 and TDBGrid Pro 8.0
Thx
Nat
0
Comment
Question by:Gallia
[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
4 Comments
 
LVL 3

Expert Comment

by:santosh26676
ID: 10738627
I have not used TRUE DBGrid but you could do the following:

On rowcolchange event check the contents of the column and based on the value set the current row to next row or previous row.

0
 
LVL 39

Accepted Solution

by:
appari earned 150 total points
ID: 10738718
set the FetchRowStyle property of the grid to true(in properties, splits tab expand the split0(default) and change property of FetchRowStyle to true). add the following code. this one checks if column 0 text if it is Zero then locks the row otherwise not.


Private Sub TDBGrid1_FetchRowStyle(ByVal Split As Integer, Bookmark As Variant, ByVal RowStyle As TrueDBGrid60.StyleDisp)
If TDBGrid1.Columns(0).CellText(Bookmark) = "0" Then
    RowStyle.Locked = True
Else
    RowStyle.Locked = False
End If
End Sub
0
 
LVL 39

Expert Comment

by:appari
ID: 10738742
you are using TDB8.0
my grid version is tdb6, must be simillar in version 8. basic idea is set the property fetchrowstyle to true and write code in fetchrowstyle event.
0
 

Author Comment

by:Gallia
ID: 10741733
Thanks Appari,

I confirm, TDB8.0 is the same as TDB6 (regarding fetchrowstyle).
I wil post 2 more questions (1-Duplicate rows in TDB8.0, 2-Adding new row in unbound TDB8), please if you have time, take a look.

gallia
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add and format columns in vb6 7 70
MsgBox 4 71
Set email body to html using vbscript 6 71
VB script to continue despite error 2 52
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

749 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