public override void AddUIControlPackage(I_SimpleControlManager control, I_LabelControlManager labelControlManager) { var localControlManager = control as SimpleControlManagerForOneDataForm; var localLabelControlManager = labelControlManager as LabelControlManager; //FrameworkElement labelControl = null; //if (!localControlManager.RelatedControl.Any()) //{ //var labelControl = LabelHelper.GenerateLabelControl(title, (control as SimpleControlManagerForOneDataForm).ColumnUISettingDTO); //////localControlManager.RelatedControl.Add(labelControl); //} //else //var labelControl = localControlManager.RelatedControl.First(); //if (controlPackage.UIControl.Control is I_View_Container) // (controlPackage.UIControl.Control as I_View_Container).SetExpanderInfo(labelControl.Control); //else //AddControlToGrid(labelControl); //} //var uiControl = controlPackage.UIControl; AddControlToGrid(localControlManager.MyControlHelper.WholeControl, localControlManager.ColumnUISettingDTO.UIColumnsType, localControlManager.ColumnUISettingDTO.UIRowsCount, localLabelControlManager.WholeControl); }
//public void RemoveSelectedDataContainers() //{ // //if (AgentHelper.GetDataEntryMode( EditTemplate) == DataMode.Multiple) // //{ // dataGridHelper.RemoveSelectedDataContainers(); // //} //} //private List<DataMessageItem> rowValidationMessages = new List<DataMessageItem>(); //public void AddValidation(DataMessageItem item) //{ // rowValidationMessages.Add(item); // SetTooltip(item.CausingDataItem); // SetColor(item.CausingDataItem); //} //public void ClearValidation(DP_DataRepository dataitem) //{ // var validationMessage = rowValidationMessages.Where(x => x.CausingDataItem == dataitem).ToList(); // foreach (var item in validationMessage) // validationMessage.Remove(item); // SetTooltip(dataitem); // SetColor(dataitem); //} //public void ClearValidation() //{ // List<DP_DataRepository> dataItems = new List<DP_DataRepository>(); // foreach (var item in rowValidationMessages) // { // dataItems.Add(item.CausingDataItem); // } // rowValidationMessages.Clear(); // foreach (var item in dataItems) // { // SetTooltip(item); // SetColor(item); // } //} //private void SetColor(object dataItem) //{ // var color = InfoColor.Black; // var validationMessage = rowValidationMessages.Where(x => x.CausingDataItem == dataItem); // if (validationMessage.Any()) // color = validationMessage.Last().Color; // if (color != InfoColor.Black) // dataGridHelper.SetColor(dataItem, color); // else // dataGridHelper.ClearColor(dataItem); //} //private void SetTooltip(object dataItem) //{ // var tooltip = ""; // var validationMessage = rowValidationMessages.Where(x => x.CausingDataItem == dataItem); // foreach (var item in validationMessage) // tooltip += (tooltip == "" ? "" : Environment.NewLine) + item.Message; // if (tooltip != "") // dataGridHelper.SetTooltip(dataItem, tooltip); // else // dataGridHelper.ClearTooltip(dataItem); //} public override void AddUIControlPackage(I_SimpleControlManager control, I_LabelControlManager labelControlManager) { //if (!(control as LocalDataGridControlManager).RelatedControl.Any()) //{ // var labelControl = new DataGridUIControl(); //var labelControl = LabelHelper.GenerateLabelControl(title, (control as SimpleControlManagerForMultipleDataForm).DataGridColumn.ColumnSetting); //////(control as SimpleControlManagerForMultipleDataForm).RelatedControl.Add(labelControl); (control as SimpleControlManagerForMultipleDataForm).DataGridColumn.Header = (labelControlManager as LabelControlManager).WholeControl; // } dataGridHelper.dataGrid.Columns.Add((control as SimpleControlManagerForMultipleDataForm).DataGridColumn); }
public abstract void AddUIControlPackage(I_SimpleControlManager controlManager, I_LabelControlManager labelControlManager);
public void RemoveUIControlPackage(I_SimpleControlManager controlManager) { dataGridHelper.dataGrid.Columns.Add((controlManager as SimpleControlManagerForMultipleDataForm).DataGridColumn); }