hide button

sullyman

Active member
Joined
Nov 11, 2009
Messages
37
Programming Experience
Beginner
I would like to display a button if no records exist and hide the same button if a record exists. How can i achieve this please
 
[button id].visible = [check if records exist]

Example
VB.NET:
btnSubmit.Visible = reader.read
 
Thanks for reply. I am using a bound Verticalgrid control from Devexpress

There is no read attribute for the VGridcontrol

e.g.
SimpleButton1.Visible = VGridControl1
 
Is there a Count property?

If so then something along these lines will work:
SimpleButton1.Visible = (RecordsObject.Count = 0)
 
Hi J,

Yes, there is a recordcount as follows but i have tried the following but have had no luck so far

If VGridControl1.RecordCount = 0 Then
SimpleButton1.Visible = True
Else
SimpleButton1.Visible = False
End If
End Sub
 
Hi J - I mean it is not working. I have tried other properties also but have got nowhere

Edit:
Many thanks. i had the code in the wrong place.

Trust a Noob to get it wrong :D
 
Back
Top