protected void iEventTableList_SelectedIndexChanged(object sender, EventArgs e) { var f = (FormView)EventDialog.FindControl("EventForm"); var ddl = (DropDownList)f.FindControl("iEventColumnList"); for (int i = 1; i < ddl.Items.Count; i++) { ddl.Items.RemoveAt(i); } }
protected void EventEditButton_Click(object sender, EventArgs e) { if (EventGridView.Rows.Count == 0) { return; } if (EventGridView.SelectedIndex != -1) { ((FormView)EventDialog.FindControl("EventForm")).ChangeMode(FormViewMode.Edit); EventDialog.Caption = "Редактирование события"; EventDialog.Show(EditorMode.Edit); } }
protected void EventSaveHandler(object sender, EventArgs e) { var formView = EventDialog.FindControl("EventForm") as FormView; if (formView.CurrentMode == FormViewMode.Edit) { EventForm.UpdateItem(false); } else if (formView.CurrentMode == FormViewMode.Insert) { EventForm.InsertItem(false); } EventDialog.Close(); }
protected void EventAddButton_Click(object sender, EventArgs e) { ((FormView)EventDialog.FindControl("EventForm")).ChangeMode(FormViewMode.Insert); EventDialog.Caption = "Создание события"; EventDialog.Show(EditorMode.Insert); }