private static void PgrdPriceEditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e) { PropertyGridSpinEditor editorGridSpinEditor = e.Editor as PropertyGridSpinEditor; if (editorGridSpinEditor == null) { return; } BaseSpinEditorElement element = editorGridSpinEditor.EditorElement as BaseSpinEditorElement; switch (e.Item.Name) { case "LineThickness": case "BarLineThickness": if (element != null) { element.MinValue = 1; element.MaxValue = 10; } break; case "Period": if (element != null) { element.MinValue = 1; element.MaxValue = 999; } break; } }
private void radPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e) { PropertyGridSpinEditor editor = e.Editor as PropertyGridSpinEditor; if (editor == null) { return; } BaseSpinEditorElement element = editor.EditorElement as BaseSpinEditorElement; switch (e.Item.Name) { case "Displacement": element.MinValue = 1; element.MaxValue = 10000; break; case "Number of seats": element.MinValue = 1; element.MaxValue = 60; break; case "Weight": element.MinValue = 1; element.MaxValue = 10000; break; } }
private void RadPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e) { PropertyGridUITypeEditor editor = e.Editor as PropertyGridUITypeEditor; if (editor != null) { PropertyGridUITypeEditorElement el = editor.EditorElement as PropertyGridUITypeEditorElement; el.Button.Visibility = ElementVisibility.Collapsed; } }
private static void PgrdStudiesEditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e) { switch (e.Item.Name) { case "Color": { PropertyGridColorEditor gridColorEditor = e.Editor as PropertyGridColorEditor; if (gridColorEditor != null) { RadColorBoxElement colorBoxElement = ((PropertyGridColorEditor)e.Editor).EditorElement as RadColorBoxElement; if (colorBoxElement != null) { colorBoxElement.ColorDialog.ColorDialogForm.ShowWebColors = false; colorBoxElement.ColorDialog.ColorDialogForm.ShowSystemColors = false; colorBoxElement.ColorDialog.ColorDialogForm.ActiveMode = ColorPickerActiveMode.Basic; } } return; } } PropertyGridSpinEditor editorGridSpinEditor = e.Editor as PropertyGridSpinEditor; if (editorGridSpinEditor == null) { return; } BaseSpinEditorElement element = editorGridSpinEditor.EditorElement as BaseSpinEditorElement; switch (e.Item.Name) { case "LineThickness": if (element != null) { element.MinValue = 0; element.MaxValue = 10; } break; } }
private static void PgrdChartEditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e) { switch (e.Item.Name) { case "ColorSchemes": { PropertyGridDropDownListEditor editor = e.Editor as PropertyGridDropDownListEditor; BaseDropDownListEditorElement editorElement = editor.EditorElement as BaseDropDownListEditorElement; if (editorElement != null) { editorElement.ValueMember = "Text"; editorElement.DisplayMember = "Text"; editorElement.DataSource = Scheme.Instance().Schemes.Select(s => new ItemChart(s.Key, s.Value)); editorElement.SelectedValue = ((PropertyGridItem)e.Item).Value.ToString(); } return; } case "Position": { PropertyGridDropDownListEditor editor = e.Editor as PropertyGridDropDownListEditor; BaseDropDownListEditorElement editorElement = editor.EditorElement as BaseDropDownListEditorElement; if (editorElement != null) { IList <ItemChart> items = new List <ItemChart> { new ItemChart(Program.LanguageDefault.DictionarySettings["LessChart"], Program.LanguageDefault.DictionarySettings["LessChart"]), new ItemChart(Program.LanguageDefault.DictionarySettings["BottomChart"], Program.LanguageDefault.DictionarySettings["BottomChart"]) }; editorElement.ValueMember = "Text"; editorElement.DisplayMember = "Text"; editorElement.DataSource = items; editorElement.SelectedValue = ((PropertyGridItem)e.Item).Value.ToString(); } } break; } PropertyGridSpinEditor editorGridSpinEditor = e.Editor as PropertyGridSpinEditor; if (editorGridSpinEditor == null) { return; } BaseSpinEditorElement element = editorGridSpinEditor.EditorElement as BaseSpinEditorElement; switch (e.Item.Name) { case "Decimals": if (element != null) { element.MinValue = 0; element.MaxValue = 3; } break; case "PaddingTop": case "PaddingBottom": if (element != null) { element.MinValue = 0; element.MaxValue = 30; } break; case "PaddingRight": if (element != null) { element.MinValue = 0; element.MaxValue = 300; } break; case "ChartViewport": case "History": if (element != null) { element.MinValue = 2; element.MaxValue = 10000; } break; } }
private void pgrdStudy_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e) { PropertyGridColorEditor gridColorEditor = e.Editor as PropertyGridColorEditor; if (gridColorEditor != null) { RadColorBoxElement colorBoxElement = ((PropertyGridColorEditor)e.Editor).EditorElement as RadColorBoxElement; if (colorBoxElement != null) { //colorBoxElement.ColorDialog.ColorDialogForm.ShowSystemColors = false; //colorBoxElement.ColorDialog.ColorDialogForm.ShowWebColors = false; colorBoxElement.ColorDialog.ColorDialogForm.ActiveMode = Telerik.WinControls.ColorPickerActiveMode.Basic; } } PropertyGridSpinEditor editor = e.Editor as PropertyGridSpinEditor; if (editor == null) { return; } BaseSpinEditorElement element = editor.EditorElement as BaseSpinEditorElement; switch (e.Item.Name) { case "LineThicknessValue": case "LineThicknessAverage": case "LineThicknessParameters": case "LineThickness2Parameters": if (element != null) { element.MinValue = 1; element.MaxValue = 10; } break; case "ShortCycle": case "ShortTermParameters": if (element != null) { element.MinValue = 1; element.MaxValue = 999; } break; case "LongCycle": case "LongTermParameters": if (element != null) { element.MinValue = 1; element.MaxValue = 999; } break; case "Periods": case "PeriodsParameters": if (element != null) { element.MinValue = 1; element.MaxValue = 999; } break; } }
private void radPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e) { this.ShowEventMessage("EditorInitialized"); }