Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, July 4, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Question about looping through controls of a form interface
Ali Youssefi
Posts: 18
 
Question about looping through controls of a form interfaceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Sep 09 8:25 AM
Hi everyone,

I have a question about how to properly use form.Controls. form is essentially Sage.Form.Interfaces.(whatever the name of your form is).
Anyway my question is how can I loop through a collection of controls of an interface.
I have tried:
foreach (System.Web.UI.WebControls.CompositeControl c in form.Controls)
and
foreach (System.Web.UI.Control c in form.Controls)
and
foreach(Sage.Platform.Controls.IControl c in form.Controls)

I have tried various other methods but these seemed the most reasonable.
Any and all help would be appreciated.

Thank you,
Ali
[Reply][Quote]
Todd Hardin
Posts: 43
 
Re: Question about looping through controls of a form interfaceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Sep 09 11:42 PM
Hi Ali - are you saying that these techniques are not working - OR - are you asking for different ways to accomplish the same objective?

Todd
[Reply][Quote]
Ali Youssefi
Posts: 18
 
Re: Question about looping through controls of a form interfaceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Sep 09 8:55 AM
Hi Todd,

The techniques above did not work for me. I am looking for a way to loop through a collection of the controls on the page without using javascript. I noticed the .Controls collection but was unfamiliar about how to loop through it. Do you know of a way of being able to loop through the controls of the interface in C#?

Thanks in advance,
Ali
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Question about looping through controls of a form interfaceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Oct 09 1:55 AM
Best route would likely be to cast the form interface type passed to the method to it's native type:

UserControl nativeform = (UserControl)form.NativeForm; // Could also use as SmartPart, EntityBoundSmartPart, or even the MyQuickFormName  
foreach (Control c in nativeform.Controls)
{
//do something
}


Give that a try.

-Ryan
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 7/4/2025 3:23:01 PM