private void listaContattiInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells["Value"].EditorComponent == null) { int? idCondominio = null; if (sceltaCondominioCombo1.CondominioSelected != null && !chkTutti.Checked) idCondominio = sceltaCondominioCombo1.CondominioSelected.ID; var ucc = new UltraControlContainerEditor(); var editingControl = new SceltaPersonaCombo(); editingControl.LoadData(idCondominio); editingControl.Insert(_parametriLettera.IdPersonaAttiva.GetValueOrDefault()); editingControl.CurrentEditRow = e.Row; ucc.EditingControl = editingControl; ucc.EditingControlPropertyName = "IdPersona"; _editingControl.Add(editingControl); editingControl.SelectItem += editingControlSelectItem; var renderingControl = new SceltaPersonaCombo(); renderingControl.LoadData(idCondominio); renderingControl.Insert(_parametriLettera.IdPersonaAttiva.GetValueOrDefault()); renderingControl.CurrentEditRow = e.Row; ucc.RenderingControl = renderingControl; ucc.RenderingControlPropertyName = "IdPersona"; e.Row.Cells["Value"].EditorComponent = ucc; } }
private void grdMachine_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { grdMachine.DisplayLayout.UseScrollWindow = Infragistics.Win.UltraWinGrid.UseScrollWindow.None; // as per Mike S. foreach (var row in e.Layout.Rows) { var height = 25; foreach (var cell in row.Cells) { if (cell.Column.Key == "Events") { cell.Appearance.BackColor = Color.Aqua; } else { var transition = (Transition)cell.Value; cell.Value = transition.TransitionName; cell.Tag = transition; cell.Appearance.BackColor = transition.TranistionID == 0 ? Color.LightSalmon : Color.AntiqueWhite; var renderer = new TransitionControlLibrary.TransitionDisplayControl(); height = renderer.ButtonHeight; renderer.DisplayTransition(transition); renderer.DisplayClosing += new TransitionControlLibrary.TransitionDisplayControl.TransitionDisplayEventHandler(transitionDisplayControl_DisplayClosing); var ccEditor = new UltraControlContainerEditor(); ccEditor.EditingControl = renderer; ccEditor.EnterEditModeMouseBehavior = EnterEditModeMouseBehavior.EnterEditModeAndClick; cell.EditorComponent = ccEditor; } row.Height = height + 2; } } SetGridDisplayColor(grdMachine); foreach (var column in e.Layout.Bands[0].Columns) { if (column.Key != "Events") { column.Width = grdMachine.Width / e.Layout.Bands[0].Columns.Count; } } }