Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Flex Grid - Dissabling cells

Status
Not open for further replies.

Dukes

Programmer
May 27, 2002
8
0
0
GB
Hi, Please could anyone assist me. I have a form with a Flex Grid. The flex grid shows the ID, description and date of an item. The user is able to update, delete and add info. Problem - User can also make changes to the first and last cells (the auto generated ID and the Date field). I wish to dissable these on refresh, but am having problems, can anyone advise please....Thanks in advance Dukes sdl187@hotmail.com
 
To the best of my knowledge you cannot disable individual cells of the flexgrid, but what you can do is to perform various checks in the click event of the grid. Something like the following:

Private Sub grdGrid_Click()

Dim lBol_AllowUpdate As Boolean
Dim lInt_SelCol As Integer

lInt_SelCol = grdGrid.Col

Select Case lInt_SelCol
Case 0, grdGrid.Cols - 1
lBol_AllowUpdate = False
Case else
lBol_AllowUpdate = True
End Select

If (lBol_AllowUpdate = True) Then
<perform update functions>
End If

End Sub
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
Hi,

Thanks for the response, I will try it and let you know. Rgs Dukes
 
did you make the header row and col fixed? this prevents user from changing these values. use the fixed rows and fixed cols property.
 
Thanks,
I have used the following which works

grdDataGrid1.Columns(2).Locked = True

Thanks for youe help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top