private void InternalCreateRadio() { __Control c = this.Parent; if (c == null) { return; } var old = button; var old_checked = old.@checked; // remove events from the old element if (_CheckedChanged.EventInternal != null) { this.button.onchange -= _CheckedChanged.EventInternal; } button.Orphanize(); this.button = IHTMLInput.CreateRadio(c.ControlGroupName, old.value, old_checked); // we need to rewire this.button.id = this.label.htmlFor; InternalUpdate(); // add events to the new element if (_CheckedChanged.EventInternal != null) { this.button.onchange += _CheckedChanged.EventInternal; } //Console.WriteLine("checked: " + old_checked); }