Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Locking an entire row of True DBGrid

Posted on 2004-04-01
4
Medium Priority
?
3,183 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
  • 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 600 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

971 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