private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { if (e.Column.Name.ToLower() == "productid") { RadDropDownListEditor rdd = (RadDropDownListEditor)e.ActiveEditor; //rdd.OnValueChanged += RadDropDownListEditorElement el = (RadDropDownListEditorElement)rdd.EditorElement; el.ValueChanged += new EventHandler(rddEdit_SelectedValueChanged); } }
private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) { RadDropDownListEditor comboBoxEditor = this.radGridView1.ActiveEditor as RadDropDownListEditor; if (comboBoxEditor != null) { comboBoxEditor.EditorElement.StretchVertically = false; comboBoxEditor.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList; comboBoxEditor.DropDownSizingMode = SizingMode.UpDownAndRightBottom; } }
void grid_CellEditorInitialized(object sender, GridViewCellEventArgs e) { RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor; if (editor != null) { this.GridControl.CellEditorInitialized -= grid_CellEditorInitialized; RadDropDownListEditorElement element = editor.EditorElement as RadDropDownListEditorElement; element.ShowPopup(); } }
public void EventCellEditorInitialized(object sender, GridViewCellEventArgs e) { // This method is needed to set the font of [DropDownListEditor] - otherwise it will not work // IInputEditor editor = e.ActiveEditor; if (editor != null && editor is RadDropDownListEditor) { RadDropDownListEditor dropDown = (RadDropDownListEditor)editor; RadDropDownListEditorElement element = (RadDropDownListEditorElement)dropDown.EditorElement; element.Font = Grid.Font; element.ListElement.Font = Grid.Font; SetSizeOfCombobox(element); } }
private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { if (!NBConfig.CheckPermission((this.Tag != null? this.Tag.ToString():""), this.GetType().Name, "Delete")) { //e.ActiveEditor if (e.Column.Name == "tipehadirid") { int iHariRaya; // , iCutiTahunan; RadDropDownListEditor rdd = (RadDropDownListEditor)e.ActiveEditor; RadDropDownListEditorElement el = (RadDropDownListEditorElement)rdd.EditorElement; iHariRaya = el.Items.IndexOf("Hari Raya"); //iCutiTahunan = el.Items.IndexOf("Cuti Tahunan"); el.Items[iHariRaya].Enabled = false; //el.Items[iCutiTahunan].Enabled = false; } } }
private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { if (!delete_) { //e.ActiveEditor if (e.Column.Name == "tipehadirid") { int iHariRaya; // , iCutiTahunan; RadDropDownListEditor rdd = (RadDropDownListEditor)e.ActiveEditor; RadDropDownListEditorElement el = (RadDropDownListEditorElement)rdd.EditorElement; iHariRaya = el.Items.IndexOf("Hari Raya"); //iCutiTahunan = el.Items.IndexOf("Cuti Tahunan"); el.Items[iHariRaya].Enabled = false; //el.Items[iCutiTahunan].Enabled = false; } } }
private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { if (e.Column == radGridView1.Columns["cbCol"]) { RadDropDownListEditor cboEditor = this.radGridView1.ActiveEditor as RadDropDownListEditor; cboEditor.EditorElement.StretchVertically = false; cboEditor.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList; cboEditor.DropDownSizingMode = SizingMode.UpDownAndRightBottom; } if (e.Column == radGridView1.Columns["mcbCol"]) { RadMultiColumnComboBoxElement mcboEditor = (RadMultiColumnComboBoxElement)e.ActiveEditor; mcboEditor.EditorControl.Columns["Text"].MinWidth = 300; mcboEditor.EditorControl.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; mcboEditor.EditorControl.ShowRowHeaderColumn = false; mcboEditor.DropDownMinSize = new Size(350, 150); mcboEditor.DropDownSizingMode = SizingMode.UpDownAndRightBottom; } }
void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) { if (this.radGridView1.ActiveEditor != null) { if (this.radGridView1.ActiveEditor is RadDropDownListEditor) { RadDropDownListEditor comboboxEditor = this.radGridView1.ActiveEditor as RadDropDownListEditor; comboboxEditor.EditorElement.Alignment = ContentAlignment.MiddleCenter; comboboxEditor.EditorElement.StretchVertically = false; this.radGridView1.CurrentCell.Alignment = ContentAlignment.MiddleCenter; } else if (this.radGridView1.ActiveEditor is RadDateTimeEditor) { RadDateTimeEditor comboboxEditor = this.radGridView1.ActiveEditor as RadDateTimeEditor; comboboxEditor.EditorElement.Alignment = ContentAlignment.MiddleCenter; comboboxEditor.EditorElement.StretchVertically = false; this.radGridView1.CurrentCell.Alignment = ContentAlignment.MiddleCenter; } } }
void radGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e) { if (e.Column.HeaderText == "Food") { if (this.radGridView1.CurrentRow.Cells["FoodType"].Value != DBNull.Value && this.radGridView1.CurrentRow.Cells["FoodType"].Value != null) { RadDropDownListEditor editor = (RadDropDownListEditor)this.radGridView1.ActiveEditor; RadDropDownListEditorElement editorElement = (RadDropDownListEditorElement)editor.EditorElement; if (int.Parse(this.radGridView1.CurrentRow.Cells["FoodType"].Value.ToString()) == 0) { editorElement.DataSource = vegetablesList; } else { editorElement.DataSource = fruitsList; } editorElement.SelectedValue = null; editorElement.SelectedValue = this.radGridView1.CurrentCell.Value; } } }