Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. private void DisableControls(ListControl control, Boolean val)
  2. {
  3. if (val)
  4. {
  5. control.ClearSelection();
  6. control.Attributes.Remove("checked");
  7. control.Attributes.Add("disabled", "disabled");
  8. }
  9. else
  10. {
  11. control.Attributes.Remove("disabled");
  12. }
  13. }
  14.  
  15. private void DisableControls(ListControl control, Boolean val)
  16. {
  17. if (val)
  18. {
  19. control.ClearSelection();
  20. foreach (ListItem item in control.Items)
  21. {
  22. item.Enabled = false;
  23. }
  24. }
  25. else
  26. {
  27. foreach (ListItem item in control.Items)
  28. {
  29. item.Enabled = true;
  30. }
  31. }
  32. }
  33.  
  34. private void DisableControls(ListControl control, Boolean val)
  35. {
  36. if (val)
  37. {
  38. control.ClearSelection();
  39. control.Enabled = false;
  40. }
  41. else
  42. {
  43. control.Enabled = true;
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement