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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disabling some checkboxes in a listbox

Status
Not open for further replies.

seosamh

Programmer
Aug 2, 2000
29
IE
Is it possible to disable particular checkbox entries in a listbox?&nbsp;&nbsp;I am filling a listbox with data from sql server, while I need to fill the list box with all the data, I only want users to be able to check certain boxes (i.e. those they have permission to check)<br><br>Thanks<br><br>Seosamh
 
Hi,
I dont think there's any property or method for this.But u can do it programmatically.
While loading the list box u might be knowing what all can be checked & what all cant be checked.
So while loading the list items which can't be checked u set the itemdata property with odd numbers & the one which can be checked with even numbers.
So when the user clicks the item u can chek this itemdata property & u can give him a message like this cant be selected.
I hope u got it. All the best.

Regards,
K.Purushothaman.
Software Engineer,
California Software.




 
If I understand correctly you want to disable the row in the list box the user does not have access to check. If this is the case you could set up a function which is called from the on_click event of the listbox passing in the index of the item the user clicked on and checking in your list of permissions whether that user is allowed to select that item in the list. if not pass back false and set the list item to unchecked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top