Stack Exchange
Set SharePoint BaseFieldControl BooleanField to true
I'm creating a custom SharePoint 2013 edit form with a checkbox control. I'm using the SharePoint BaseFieldControl object.
 BaseFieldControl webControl = field.FieldRenderingControl;
 webControl.ID = string.Format("ctrl_{0}",field.InternalName);
 webControl.FieldName = field.Title;this.Controls.Add(webControl);
 webControl.ControlMode = SPControlMode.edit;

 SPQuery camlQuery = new SPQuery();                
 camlQuery.ViewXml = String.Format("<View><Query><Where><Geq><FieldRef Name='ID'/>" +
 <Type='Number'>{0}</Value></Geq></Where></Query><RowLimit>100</RowLimit></View>", id);

 SPListItemCollection items = SafeguardingList.GetItems(camlQuery);               
 SPListItem item = items[0];

 if (items.Count > 0 && !string.IsNullOrEmpty(item[field.Title].ToString()))
 {                    
  SPFieldType fieldType = field.Type;
  switch (fieldType)
  {
    case SPFieldType.Boolean:
    this.Controls.Add(webControl);
    break;
  }
}

I'm trying to set the checkbox control to "True" when the page is rendered.
<input name="name$ctl00$BooleanField" id="name_ctl00_BooleanField" type="checkbox"/>

I've tried:
webControl.ItemFieldValue = "1";
webControl.Field.DefaultValue = "1";
This doesn't seem to work.
