void grid_CellEditorInitialized(object sender, GridViewCellEventArgs e)
        {
            RadDateTimeEditor editor = e.ActiveEditor as RadDateTimeEditor;

            if (editor != null)
            {
                this.GridControl.CellEditorInitialized -= grid_CellEditorInitialized;
                RadDateTimeEditorElement  element  = editor.EditorElement as RadDateTimeEditorElement;
                RadDateTimePickerCalendar calendar = element.CurrentBehavior as RadDateTimePickerCalendar;

                calendar.PopupControl.AnimationEnabled = false;
                calendar.ShowDropDown();
            }
        }
Beispiel #2
0
        private void radGridViewSocTime_CellEditorInitialized(object sender, GridViewCellEventArgs e)
        {
            RadDateTimeEditor dateTimeEditor = e.ActiveEditor as RadDateTimeEditor;

            if (dateTimeEditor != null)
            {
                radGridViewSocTime.CellEditorInitialized -= radGridViewSocTime_CellEditorInitialized;
                RadDateTimeEditorElement editroElement = (RadDateTimeEditorElement)dateTimeEditor.EditorElement;
                MaskDateTimeProvider     provider      = editroElement.TextBoxElement.Provider as MaskDateTimeProvider;
                if (provider != null)
                {
                    provider.AutoSelectNextPart = true;
                }
            }
        }
Beispiel #3
0
                protected override void OnLoaded()
                {
                    base.OnLoaded();
                    if (this.Children.Contains(this.TextBoxItem))
                    {
                        this.Children.Remove(this.TextBoxItem);
                    }

                    TreeNodeContentElement nodeElement = this.Parent as TreeNodeContentElement;

                    if (nodeElement.NodeElement.Data != null)
                    {
                        DataRow row = nodeElement.NodeElement.Data.Tag as DataRow;
                        mainContainer.MinSize = new Size(columnWidth * row.Table.Columns.Count,
                                                         nodeElement.NodeElement.Data.TreeView.ItemHeight);

                        mainContainer.DrawFill      = true;
                        mainContainer.GradientStyle = GradientStyles.Solid;
                        mainContainer.BackColor     = nodeElement.NodeElement.BackColor;
                        mainContainer.Margin        = new Padding(-2, -4, 0, 0);
                        if (headersContainer.Children.Count == 0)
                        {
                            foreach (DataColumn col in row.Table.Columns)
                            {
                                //generate columns
                                LightVisualElement columnHeader = new LightVisualElement();
                                columnHeader.MinSize             = new System.Drawing.Size(columnWidth, 20);
                                columnHeader.StretchHorizontally = true;
                                columnHeader.Text = col.ColumnName;
                                headersContainer.Children.Add(columnHeader);
                                StyleBorder(columnHeader);

                                //generate data cells
                                if (col.ColumnName == "DeliveryType")
                                {
                                    this.dropDownList = new RadDropDownListElement();
                                    this.dropDownList.DropDownStyle = RadDropDownStyle.DropDownList;
                                    this.dropDownList.MinSize       = new System.Drawing.Size(columnWidth, 0);
                                    nodeContentContainer.Children.Add(this.dropDownList);
                                    this.dropDownList.DataSource            = Enum.GetValues(typeof(DeliveryType));
                                    this.dropDownList.SelectedValueChanged += DropDownList_SelectedValueChanged;
                                }
                                else if (col.ColumnName == "Date")
                                {
                                    this.dateEditor              = new RadDateTimeEditorElement();
                                    this.dateEditor.Format       = DateTimePickerFormat.Custom;
                                    this.dateEditor.CustomFormat = "dd/MM/yyyy";
                                    this.dateEditor.MinSize      = new System.Drawing.Size(columnWidth, 20);
                                    nodeContentContainer.Children.Add(this.dateEditor);
                                    this.dateEditor.ValueChanged += DateEditor_ValueChanged;
                                }
                                else if (col.ColumnName == "Id")
                                {
                                    this.idEditor = new LightVisualElement();
                                    this.idEditor.StretchVertically = true;
                                    this.idEditor.MinSize           = new System.Drawing.Size(columnWidth, 24);
                                    StyleBorder(this.idEditor);
                                    nodeContentContainer.Children.Add(this.idEditor);
                                }
                                else if (col.ColumnName == "ParentId")
                                {
                                    this.parentIdEditor         = new LightVisualElement();
                                    this.parentIdEditor.MinSize = new System.Drawing.Size(columnWidth, 20);
                                    this.parentIdEditor.Margin  = new System.Windows.Forms.Padding(0, -1, 0, 0);
                                    StyleBorder(this.parentIdEditor);
                                    nodeContentContainer.Children.Add(this.parentIdEditor);
                                }
                                else if (col.ColumnName == "Title")
                                {
                                    this.titleEditor        = new RadTextBoxControlElement();
                                    this.titleEditor.Margin = new System.Windows.Forms.Padding(0, -1, 0, 0);
                                    StyleBorder(this.titleEditor);
                                    this.titleEditor.MinSize = new System.Drawing.Size(columnWidth, 20);
                                    nodeContentContainer.Children.Add(this.titleEditor);
                                    this.titleEditor.TextChanged += TitleEditor_TextChanged;
                                }
                            }
                        }

                        this.dropDownList.SelectedValueChanged -= DropDownList_SelectedValueChanged;
                        this.dateEditor.ValueChanged           -= DateEditor_ValueChanged;
                        this.titleEditor.TextChanged           -= TitleEditor_TextChanged;

                        this.idEditor.Text              = row["Id"].ToString();
                        this.parentIdEditor.Text        = row["ParentId"].ToString();
                        this.titleEditor.Text           = row["Title"].ToString();
                        this.dateEditor.Value           = (DateTime)row["Date"];
                        this.dropDownList.SelectedValue = row["DeliveryType"];

                        this.titleEditor.TextChanged           += TitleEditor_TextChanged;
                        this.dateEditor.ValueChanged           += DateEditor_ValueChanged;
                        this.dropDownList.SelectedValueChanged += DropDownList_SelectedValueChanged;
                    }
                }