public void SetControl(IEditableControl userControl) { this.userControl = userControl; //userControl.SetValue(Grid.RowProperty, 0); userControl.ReadOnly = false; //mainGrid.Children.Add(userControl); placeHolder.Children.Add((Control)userControl); }
/// <summary> Implements <see cref="ISmartPage.RegisterControlForDirtyStateTracking">ISmartPage.RegisterClientSidePageEventHandler</see>. </summary> public void RegisterControlForDirtyStateTracking(IEditableControl control) { ArgumentUtility.CheckNotNull("control", control); if (_isPreRenderComplete) { throw new InvalidOperationException( "RegisterControlForDirtyStateTracking must not be called after the PreRenderComplete method of the System.Web.UI.Page has been invoked."); } _trackedControls[control] = control; }
public void EditSelected() { if (SelectedEntry.IsLocked) { return; } var dlg = new EditDomainObjectWindow(); IEditableControl ctrl = null; var viewModel = SelectedEntry; if (!viewModel.IsNew) { viewModel = viewModel.Clone(); } if (SelectedEntry is ScheduleEntryDTO) { var control = new usrScheduleEntryDetails(); ctrl = control; control.Fill(viewModel); dlg.SetControl(control); } else { var control = new usrChampionshipScheduleEntryEditor(); ctrl = control; control.Fill(viewModel); dlg.SetControl(control); } if (dlg.ShowDialog() == true) { IsModified = true; update((ScheduleEntryBaseDTO)ctrl.Object); } }
private void PublishResponseToEditableControl(IServerBoundControl control, XElement publishElement) { IEditableControl editableControl = (IEditableControl)control; if (publishElement.Attribute(Common.PublishFieldDisabled) != null) { editableControl.SetEditable(!Common.boolValue(publishElement.Attribute(Common.PublishFieldDisabled).Value)); } if (HasPropertyFields) { string id = publishElement.Attribute(Common.IDAttrib).Value; if (FixedContext != null) { id = id.Substring(FixedContext.Length + 1); } if (PropertyFields.ContainsKey(id)) { IDictionaryEnumerator de = PropertyFields[id].GetEnumerator(); while (de.MoveNext()) { foreach (XAttribute a in publishElement.Attributes()) { if (a.Name == de.Value.ToString()) { IEditableControl ec = (IEditableControl)de.Key; ec.SetValue(a.Value); break; } } } } } }
private static void Cut(Control control) { IEditableControl activeControl = GetActiveControl(control); activeControl?.Cut(); }
private static void Paste(Control control) { IEditableControl activeControl = GetActiveControl(control); activeControl?.Paste(); }
private static void SelectAll(Control control) { IEditableControl activeControl = GetActiveControl(control); activeControl?.SelectAll(); }
/// <summary> /// Registers a control implementing <see cref="IEditableControl"/> for tracking of it's server- and client-side /// dirty state. /// </summary> /// <param name="control"> A control implementing <see cref="IEditableControl"/> that will be tracked. </param> public void RegisterControlForDirtyStateTracking(IEditableControl control) { _smartPageInfo.RegisterControlForDirtyStateTracking(control); }