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:
  1. Private Sub HideColumns()
  2.    ' Use the DataField property to determine which column is being
  3.    ' tested. Show only three columns: ProductName, UnitPrice, and
  4.    ' UnitsInStock.
  5.    
  6.    Dim c As Column
  7.    For Each c In DataGrid1.Columns
  8.       Select Case c.DataField
  9.       Case "ProductName"
  10.          c.Visible = True
  11.       Case "UnitPrice"
  12.          c.Visible = True
  13.       Case "UnitsInStock"
  14.          c.Visible = True
  15.          c.Caption = "In Stock" ' Change the column header.
  16.       Case Else ' Hide all other columns.
  17.          c.Visible = False
  18.       End Select
  19.    Next c
  20. End Sub