05-04-2012 10:09 AM
SL 7.5.4 SQL Server
I have a Radio Group connected to a Boolean field, with Yes and No as selections. When the form displays and the field is not populated with a 1 or 0 (null) it displays "Yes", "No" checkboxes and a third box which is populated.
After Yes or no is selected, the third checkbox disappears.
Is there a way to eliminate the third checkbox for null? I can't set the field to a default value for other reasons
05-09-2012 06:07 AM
You may remove the data binding and use the "text field" and "value field" in the list section of the radio group's properties. Unfortunately, you have to code the saving of changes of control by your own.
05-23-2012 09:49 AM
Here's a hack:
1. add a radio button for null... under "Items" in the radio group, add a blank entry at the end (text = [blank], value = [blank]).
2. add a Style Scheme with an unused name (in this example I used "hidelast") to the radio group.
// hide blank radio buttons
SmartPart smartpart = form.NativeForm as SmartPart;
Page page = smartpart.Page;
string script = "Ext.select('fieldset.radio table.hidelast tbody tr td:last-child').hide();";
ScriptManager.RegisterStartupScript(page, page.GetType(), "hidelastradio", script, true);
(You may need to reference System.Web.Extensions.dll in your project, or redo the above to work with a C# snippet.)
4. Set the onload to run for the "On Repaint Event" or else those blank radio buttons will show up after lookups etc.