|
-
Jul 2nd, 2002, 06:33 AM
#1
Thread Starter
Registered User
datagrid on form - enter data in cell event
doe anyone know how to trigger an event when a user enters data in a cell in a data grid. also, is it possible to disable columns (make readonly) and allow only certain columns to be edited.
thanks,
jeff
-
Jul 2nd, 2002, 06:39 AM
#2
Fanatic Member
Re: datagrid on form - enter data in cell event
Originally posted by jkw119
doe anyone know how to trigger an event when a user enters data in a cell in a data grid. also, is it possible to disable columns (make readonly) and allow only certain columns to be edited.
thanks,
jeff
I have used the Validate event in other controls which fires anytime somthing is done, don't know if this is any use.
As far as disabling the columns, I don't know.
You can however hide them. The following code hides columns if it is of any use.
VB Code:
Private Sub HideColumns()
' Use the DataField property to determine which column is being
' tested. Show only three columns: ProductName, UnitPrice, and
' UnitsInStock.
Dim c As Column
For Each c In DataGrid1.Columns
Select Case c.DataField
Case "ProductName"
c.Visible = True
Case "UnitPrice"
c.Visible = True
Case "UnitsInStock"
c.Visible = True
c.Caption = "In Stock" ' Change the column header.
Case Else ' Hide all other columns.
c.Visible = False
End Select
Next c
End Sub
Gary Lowe 
VB6 (Enterprise) SP5
ADO 2.6
SQL Server 7 SP3
OK I know my spelling and grammer is crap so don't quote me on it!
To err is human to take the P! is only natural !!
Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|