public override bool EndEdit() { RadDropDownListEditorElement element = this.EditorElement as RadDropDownListEditorElement; string text = element.Text; RadListDataItem item = null; foreach (RadListDataItem entry in element.Items) { if (entry.Text == text) { item = entry; break; } } if ((item == null) && (InputValueNotFound != null)) { // Get cell for handling CellEndEdit event this.cell = (this.EditorManager as GridViewEditManager).GridViewElement.CurrentCell; // Add event handling for setting value to cell (this.OwnerElement as GridComboBoxCellElement).GridControl.CellEndEdit += new GridViewCellEventHandler(OnCellEndEdit); this.e = new InputValueNotFoundArgs(element); this.InputValueNotFound(this, this.e); } return(base.EndEdit()); }
private void Form1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e) { RadDropDownListEditorElement editor = sender as RadDropDownListEditorElement; if (editor?.SelectedItem != null && editor.SelectedItem.Text == "что это?") { ShowHelpForm(_columnName); } }
private void rddEdit_SelectedValueChanged(object sender, EventArgs e) { RadDropDownListEditorElement rdd = (RadDropDownListEditorElement)sender; if (rdd.SelectedItem != null) { DataRowView data = (DataRowView)rdd.SelectedItem.DataBoundItem; radGridView1.CurrentCell.RowInfo.Cells["custtypeid"].Value = data.Row["custtypeid"]; } }
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); } }
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; } } }
public void SetSizeOfCombobox(RadDropDownListEditorElement element) { int RowCount = DefaultRowCountOfDropDownList; if (element.DataSource is DataTable) { RowCount = (element.DataSource as DataTable).Rows.Count; } else if (element.DataSource is IList <Model.SimpleEntity> ) { RowCount = (element.DataSource as IList <Model.SimpleEntity>).Count; } if (element.DropDownWidth < MinimumDropDownWidth) { element.DropDownWidth = MinimumDropDownWidth; } element.DropDownHeight = System.Math.Min(RowCount * OneRowHeightOfDropDownList, MaximumDropDownHeight); }
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; } } }
/// <summary> /// Constructor /// </summary> /// <param name="editorElement">Editor assiciated element</param> internal protected InputValueNotFoundArgs(RadDropDownListEditorElement editorElement) { this.EditorElement = editorElement; this.Text = editorElement.Text; }
public RadDropDownListEditorAutoCompleteAppendHelper(RadDropDownListEditorElement element) : base((RadDropDownListElement)element) { }