Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
Nested Foreach on UltraTab
posted

When I run the following nested loop thru the UltraTabPages, it only runs for the first tabpage and groupbox, then exits. I need help in order to run the foreach loops for the four UltraTabPages.

  1. /// <summary>
  2. /// True for ReadOnly
  3. /// </summary>
  4. /// <param name="b"></param>
  5. private void DecideReadOnly(bool b)
  6. {
  7. foreach(Infragistics.Win.UltraWinTabControl.UltraTab tab in ultraTabControl1.Tabs)
  8. {
  9. foreach (GroupBox gb in ultraTabControl1.Tabs[tab.Key].TabPage.Controls)
  10. {
  11. foreach (Control c in gb.Controls)
  12. {
  13. if (c is Infragistics.Win.UltraWinEditors.UltraDateTimeEditor)
  14. {
  15. var dte = (Infragistics.Win.UltraWinEditors.UltraDateTimeEditor)c;
  16. dte.ReadOnly = b;
  17. }
  18.  
  19. if (c is TextBox)
  20. {
  21. var txt = (TextBox)c;
  22. txt.ReadOnly = b;
  23. }
  24. }
  25.  
  26. }
  27. }
  28. }