Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, February 21, 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: C# / radiogroup question
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
C# / radiogroup questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Mar 08 10:05 AM
I am trying to use the C# Code snippet at the bottom of the page to toggle a control's visibility on and off..
I am getting the error "'System.Web.UI.WebControls.ListItemCollection' does not contain a definition for 'text' "

I have two Items with text/value of Yes and No. I am having trouble with the syntax to access these properties... This is my latest attempt "(MarketingICContact.Items.text=="Yes")"

What am I looking for here? Thanks


Sage.Entity.Interfaces.IODMCERTPC objODM = BindingSource.Current as Sage.Entity.Interfaces.IODMCERTPC;
if (MarketingICContact.Items.text=="Yes")
{
MarketingContactName.Visible = false;
}

else
{
MarketingContactName.Visible = true;
}
[Reply][Quote]
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Re: C# / radiogroup questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Mar 08 12:05 PM
Got it: 'if (MarketingICContact.Items.text=="Yes")' should be 'if (MarketingICContact.SelectedIndex==1)'
[Reply][Quote]
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Re: C# / radiogroup questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Mar 08 8:20 AM
Ok, I got my first set of controls toggling visible/hidden with a C# snippet in the onchange property of the radio group. I tried the same code with a second set of controls toggled by a radio button and am getting the following error:
'StringConverter' is unable to convert 'System.String' to 'System.Web.UI.WebControls.ListItemCollection'

Here is the code that works:
Sage.Entity.Interfaces.IODMCERTPC objODM = BindingSource.Current as Sage.Entity.Interfaces.IODMCERTPC;
if (MarketingICContact.SelectedIndex==1)
{
MarketingContactName.Visible = false;
MarketingContactName_lz.Visible = false;
MarketingContactEmail.Visible = false;
MarketingContactEmail_lz.Visible = false;
MarketingContactPhone.Visible = false;
MarketingContactPhone_lz.Visible = false;

ICContactName.Visible = false;
ICContactName_lz.Visible = false;
ICContactEmail.Visible = false;
ICContactEmail_lz.Visible = false;
ICContactPhone.Visible = false;
ICContactPhone_lz.Visible = false;
}
else
{
MarketingContactName.Visible = true;
MarketingContactName_lz.Visible = true;
MarketingContactEmail.Visible = true;
MarketingContactEmail_lz.Visible = true;
MarketingContactPhone.Visible = true;
MarketingContactPhone_lz.Visible = true;

ICContactName.Visible = true;
ICContactName_lz.Visible = true;
ICContactEmail.Visible = true;
ICContactEmail_lz.Visible = true;
ICContactPhone.Visible = true;
ICContactPhone_lz.Visible = true;
}

Here is the code that fails:
Sage.Entity.Interfaces.IODMCERTPC objODM = BindingSource.Current as Sage.Entity.Interfaces.IODMCERTPC;
if (CertTestKit.SelectedIndex==1)
{
CertRecipName.Visible = false;
CertRecipName_lz.Visible = false;
CertRecipEmail.Visible = false;
CertRecipEmail_lz.Visible = false;
CertRecipAddress.Visible = false;
CertRecipAddress_lz.Visible = false;
}

else
{
CertRecipName.Visible = true;
CertRecipName_lz.Visible = true;
CertRecipEmail.Visible = true;
CertRecipEmail_lz.Visible = true;
CertRecipAddress.Visible = true;
CertRecipAddress_lz.Visible = true;
}

Has anyone seen this or know what may be happening? I have triple checked the control names and they are correct..
[Reply][Quote]
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Re: C# / radiogroup questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Mar 08 6:30 PM
Mapping issue - Radio group was mapped to text, not items. DOH!

[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): 2/21/2025 11:13:37 PM