public AddOrEditClassForm(DBManager dbManag) { InitializeComponent(); mDBManager = dbManag; this.Text = FormTitles.ClassForm.Add; mFormState = FormState.AddingNew; RadListDataItem dropDownItem = new RadListDataItem("1"); dropDownItem.Value = 1; dropDownItem.Selected = true; gradeDropdownlist.Items.Add(dropDownItem); for (int i = 2; i <= 12; ++i) { dropDownItem = new RadListDataItem(i.ToString()); dropDownItem.Value = i; gradeDropdownlist.Items.Add(dropDownItem); } importTeachersFromTheDatabase(); changingHeadteacherReadyButton.Visible = false; teachersDropdownlist.Visible = false; changeHeadTeacherButton.Visible = false; changingHeadteacherReadyButton.Visible = true; teachersDropdownlist.Visible = true; colorPanel.BackColor = RandomColor.GetRandomColor(); gradeDropdownlist.DropDownStyle = RadDropDownStyle.DropDownList; teachersDropdownlist.DropDownStyle = RadDropDownStyle.DropDownList; }
private void AddEventRoot(RadListDataItem item) { item.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); radListBoxEvents.Items.Insert(insertIndex, item); insertIndex++; }
private void rddProduct_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (!string.IsNullOrEmpty(rddProduct.Text)) { RadListDataItem item = rddProduct.FindItemExact(rddProduct.Text, false); if (item == null) { e.Cancel = true; } } }
private void viewModeCombo_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e) { RadListDataItem item = this.viewModeCombo.SelectedItem as RadListDataItem; this.radPageView1.ViewMode = (PageViewMode)item.Value; if (this.radPageView1.ViewMode == PageViewMode.Stack) { RadPageViewStackElement stack = this.radPageView1.ViewElement as RadPageViewStackElement; stack.ItemSelectionMode = StackViewItemSelectionMode.ContentWithSelected; } }
private DockWindow GetSelectedDockWindow() { RadListDataItem item = this.radComboBox1.SelectedItem as RadListDataItem; if (item == null) { return(null); } return(item.Value as DockWindow); }
private void InitializeConstructor() { this.ObjDriver = General.GetObject <Fleet_Driver>(c => c.Id == this.DriverId); btnTestConn.Enabled = Convert.ToBoolean(ObjDriver.HasPDA); if (btnTestConn.Enabled == false) { txtTitle.Width += 112; } LoadConversation(); // timer1.Start(); this.Shown += new EventHandler(frmMessages_Shown); txtTitle.Text = ObjDriver.DriverNo.ToStr() + " - " + ObjDriver.DriverName.ToStr(); RadListDataItem item = new RadListDataItem(); item.Text = "Today"; item.Value = "0"; item.Selected = true; ddlShow.Items.Add(item); item = new RadListDataItem(); item.Text = "Yesterday"; item.Value = "1"; ddlShow.Items.Add(item); item = new RadListDataItem(); item.Text = "Customer"; item.Value = "2"; ddlShow.Items.Add(item); item = new RadListDataItem(); item.Text = "All"; item.Value = "365"; ddlShow.Items.Add(item); ddlShow.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(ddlShow_SelectedIndexChanged); // this.FormClosing += new FormClosingEventHandler(frmMessages_FormClosing); if (AppVars.listUserRights.Count(c => c.functionId == "DISABLE VIEW ALL MESSAGES") > 0) { ddlShow.Visible = false; } }
private DocumentWindow GetSelectedDocument() { RadListDataItem item = this.currentRadComboBox.SelectedItem as RadListDataItem; if (item == null) { return(null); } return(item.Value as DocumentWindow); }
private void PopulateContainerDropDown() { dropdownContainers.Items.Clear(); foreach (var item in Containers.Values) { var aContainer = new RadMenuItem(item.Name); var temp = new RadListDataItem(); temp.Text = item.Name; temp.Value = item.Id; dropdownContainers.Items.Add(temp); } }
private void LoadColumnsComboBox() { this.radComboColumnsRemove.Items.Clear(); foreach (GridViewDataColumn column in this.radGridView1.Columns) { RadListDataItem comboItem = new RadListDataItem(column.HeaderText); comboItem.Tag = column; this.radComboColumnsRemove.Items.Add(comboItem); } this.radComboColumnsRemove.SelectedIndex = this.radComboColumnsRemove.Items.Count - 1; }
public Pluginmanager() { InitializeComponent(); foreach (var p in Workspace.PluginManager.Plugins) { var item = new RadListDataItem(); item.Text = p.Info["Name"].ToString(); installedpluginsList.Items.Add(item); } }
public void LoadDays(int year, int month) { var days = pc.GetDaysInMonth(year, month); day.Items.Clear(); for (int i = 1; i <= days; i++) { RadListDataItem dataItem = new RadListDataItem(); dataItem.Text = i.ToString(); day.Items.Add(dataItem); } }
private void radComboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (radComboDemo.SelectedIndex != -1) { radTxtIndex.Text = radComboDemo.SelectedIndex.ToString(); RadListDataItem item = radComboDemo.SelectedItem; radTxtText.Text = item.Text; radComboImageAlignment.SelectedIndex = radComboImageAlignment.ListElement.FindString(item.ImageAlignment.ToString()); radComboTextAlignment.SelectedIndex = radComboTextAlignment.ListElement.FindString(item.TextAlignment.ToString()); radComboTextImageRel.SelectedIndex = radComboTextImageRel.ListElement.FindString(item.TextImageRelation.ToString()); } }
private void radGridView1_CurrentRowChanging(object sender, CurrentRowChangingEventArgs e) { if (e.NewRow == null) { AddEventRoot("CurrentRowChanging"); AddTextToListBox(" non-data-bound row"); return; } if (e.NewRow.Cells["Id"].Value == null) { return; } if (!(e.NewRow.Cells["Id"].Value is int)) { return; } int value = (int)e.NewRow.Cells["Id"].Value; RadListDataItem label = new RadListDataItem(); if (value == 3) { e.Cancel = true; label.Text = string.Format(" CurrentRowChanging, row (Id = 3) selection cancelled."); label.ForeColor = Color.Orange; if (messageBoxShow) { MessageBox.Show("The column with Id = 3 selection is cancelled.", "Selection cancellation though CurrentRowChanging event", MessageBoxButtons.OK, MessageBoxIcon.Information); messageBoxShow = false; } } else { if (e.CurrentRow != null) { label.Text = string.Format(" CurrentRowChanging, current Id = {0}, new Id = {1}", e.CurrentRow.Cells["Id"].Value, value); } else { label.Text = string.Format(" CurrentRowChanging, new Id = {0}", value); } } AddEventRoot("CurrentRowChanging"); AddTextToListBox(label); }
private void radButtonConfigModify_Click(object sender, EventArgs e) { RadListDataItem ldi = comboBoxTileConfig.SelectedItem; if (ldi != null) { string sConfigSetName = ldi.Text; this.InputBox("Modify Config Set", "Please enter the new name of the config set:", ref sConfigSetName); ConfigSet cs = new ConfigSet((int)ldi.Value, sConfigSetName); NetworkFunction.ModifyConfigSet(cs); } }
private void radButton3_Click(object sender, EventArgs e) { List <int> selectedIndexes = this.GetSelectedIndexes(); for (int i = selectedIndexes.Count - 1; i >= 0; i--) { int selectedIndex = selectedIndexes[i]; RadListDataItem item = this.radListBox1.Items[selectedIndex]; DismissItem(item); } EnableButtons(); }
private void PopulateContainerForm(RadListDataItem dropdownItem) { if (dropdownContainers.SelectedIndex > -1) { var container = Containers[dropdownItem.Value.ToString()]; textboxName.Text = container.Name; textboxId.Text = container.Id; textboxStore.Text = container.Store; textboxNew.Text = container.New; checkDiscard.Checked = container.Discard; } }
public NotificationPopup() { this.InitializeComponent(); foreach (Notification notification in NotificationCenter.ToArray()) { if (!notification.Read) { var it = new RadListDataItem(notification.Content) { Image = notification.Icon }; this.popupItems.Items.Add(it); } } }
void popup_Click(object sender, EventArgs e) { if (this.comboPopup == null) { return; } RadListDataItem dataItem = this.item.Data; this.popup.Hide(); this.comboPopup.ClosePopup(RadPopupCloseReason.CloseCalled); this.comboPopup.OwnerDropDownListElement.SelectedItem = dataItem; }
protected void PopulateColors() { RadListDataItem item = new RadListDataItem(Color.WhiteSmoke.ToString()); item.Value = Color.WhiteSmoke; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Yellow.ToString()); item.Value = Color.Yellow; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Orange.ToString()); item.Value = Color.Orange; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Pink.ToString()); item.Value = Color.Pink; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Magenta.ToString()); item.Value = Color.Magenta; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Red.ToString()); item.Value = Color.Red; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Purple.ToString()); item.Value = Color.Purple; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Blue.ToString()); item.Value = Color.Blue; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Cyan.ToString()); item.Value = Color.Cyan; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Green.ToString()); item.Value = Color.Green; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Gray.ToString()); item.Value = Color.Gray; this.ColorList.Items.Add(item); item = new RadListDataItem(Color.Brown.ToString()); item.Value = Color.Brown; this.ColorList.Items.Add(item); }
public Form1() { InitializeComponent(); this.SetEnabledQsfbButton(QSFButtons.TransparentBackground | QSFButtons.ChangeTheme, false); this.AddPriceText(); this.AttachEvents(); RadListDataItem item = new RadListDataItem("Base MSRP \t$29, 400"); item.Font = new Font(new FontFamily("Arial"), 8.25F, FontStyle.Bold); this.radListOptions.Items.Add(item); }
private void comboImageAlign_SelectedIndexChanged(object sender, EventArgs e) { RadListDataItem item = radListBoxDemo.SelectedItem; if (item == null) { return; } RadListDataItem comboItem = this.radComboImageAlign.SelectedItem; switch (comboItem.Text) { case "TopLeft": item.ImageAlignment = ContentAlignment.TopLeft; break; case "TopCenter": item.ImageAlignment = ContentAlignment.TopCenter; break; case "TopRight": item.ImageAlignment = ContentAlignment.TopRight; break; case "MiddleLeft": item.ImageAlignment = ContentAlignment.MiddleLeft; break; case "MiddleCenter": item.ImageAlignment = ContentAlignment.MiddleCenter; break; case "MiddleRight": item.ImageAlignment = ContentAlignment.MiddleRight; break; case "BottomLeft": item.ImageAlignment = ContentAlignment.BottomLeft; break; case "BottomCenter": item.ImageAlignment = ContentAlignment.BottomCenter; break; case "BottomRight": item.ImageAlignment = ContentAlignment.BottomRight; break; } }
public void LoadYear(int year) { this.year.Items.Clear(); for (int i = year - 5; i <= year + 5; i++) { RadListDataItem dataItem = new RadListDataItem(); dataItem.Text = i.ToString(); this.year.Items.Add(dataItem); if (i == year) { this.year.SelectedItem = dataItem; } } }
private void UpdateDropDown(object sender, EventArgs e) { if (radComboDemo.SelectedIndex != -1) { radTxtIndex.Text = radComboDemo.SelectedIndex.ToString(); RadListDataItem item = radComboDemo.SelectedItem; radTxtText.Text = item.Text; } else { radTxtIndex.Text = radComboDemo.SelectedIndex.ToString(); radTxtText.Text = ""; } }
public void MeterTypes() { RadListDataItem item = new RadListDataItem(); item.Text = "Fare Meter 1 (BASIC)"; item.Value = 1; ddlFareMeterType.Items.Add(item); item = new RadListDataItem(); item.Text = "Fare Meter 2 (ADVANCED)"; item.Value = 2; ddlFareMeterType.Items.Add(item); }
private void UpdateDropDownList(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e) { if (radComboDemo.SelectedIndex != -1) { radTxtIndex.Text = radComboDemo.SelectedIndex.ToString(); RadListDataItem item = radComboDemo.SelectedItem; radTxtText.Text = item.Text; } else { radTxtIndex.Text = string.Empty; radTxtText.Text = string.Empty; } }
private void OnCheck_ToggleStateChanged(object sender, StateChangedEventArgs args) { RadCheckBox check = sender as RadCheckBox; if (check.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On) { RadListDataItem item = new RadListDataItem(check.Text); check.Tag = item; this.radListOptions.Items.Add(item); } else { this.radListOptions.Items.Remove(check.Tag as RadListDataItem); } }
private void AddTextToListBox(RadListDataItem item) { if (!loading) { if (radListBox1.Items.Count > 100) { radListBox1.Items.Clear(); insertIndex = 0; } radListBox1.Items.Insert(insertIndex, item); insertIndex++; radListBox1.SelectedIndex = insertIndex - 1; radListBox1.ListElement.ScrollToItem(item); } }
private void PopulateVideoList() { listVideos.Items.Clear(); FileInfo[] fi = FileOperations.GetFilesinFolder(DataFolder.GetVideoFolder(_patientid)); if (fi != null) { foreach (FileInfo f in fi) { RadListDataItem item = new RadListDataItem(); item.Text = f.Name; item.Value = f.FullName; listVideos.Items.Add(item); } } }
public void loadCameras() { ddlCameras.Items.Clear(); videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); foreach (FilterInfo device in videoDevices) { RadListDataItem item = new RadListDataItem(); item.Text = device.Name; ddlCameras.Items.Add(item); } if (videoDevices.Count > 0) { ddlCameras.SelectedIndex = 0; } }
private async void CargarRol() { try { dropRoles.DataSource = await rolAccess.Listar(); dropRoles.ValueMember = "RolId"; dropRoles.DisplayMember = "Nombre"; RadListDataItem seleccionar = new RadListDataItem(); } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
protected void PopulateCombo() { DateTime temp = radCalendar1.DefaultView.ViewStartDate; int year = radCalendar1.CurrentCalendar.GetYear(radCalendar1.DefaultView.ViewStartDate); int month = radCalendar1.CurrentCalendar.GetMonth(radCalendar1.DefaultView.ViewStartDate); this.daysInMonth = radCalendar1.CurrentCalendar.GetDaysInMonth(year, month); for (int i = 0; i < this.daysInMonth; i++) { temp = radCalendar1.CurrentCalendar.AddDays(temp, 1); RadListDataItem item = new RadListDataItem(temp.ToShortDateString()); item.Value = temp; this.DatesList.Items.Add(item); } }
private void PopulatePhotoList() { listPhotos.Items.Clear(); FileInfo[] fi = FileOperations.GetFilesinFolder(DataFolder.GetChartsFolder()); foreach (FileInfo f in fi) { RadListDataItem item = new RadListDataItem(); item.Value = f.FullName; item.Text = f.Name.Split('.').GetValue(0).ToString(); item.TextAlignment = ContentAlignment.BottomCenter; item.Image = GetResizedImage(Image.FromFile(f.FullName)); item.TextImageRelation = TextImageRelation.ImageAboveText; listPhotos.Items.Add(item); } }
private void UnboundMode() { this.radComboDemo.DataSource = null; this.radComboDemo.Items.Clear(); Process[] processes = Process.GetProcesses(); RadListDataItem[] comboItems = new RadListDataItem[processes.Length]; for (int i = 0; i < processes.Length; ++i) { comboItems[i] = new RadListDataItem(processes[i].ProcessName); } this.radComboDemo.Items.AddRange(comboItems); this.radComboDemo.SortStyle = Telerik.WinControls.Enumerations.SortStyle.Ascending; }
private void radComboDemo_ItemDataBound(object sender, ListItemDataBoundEventArgs e) { RadListDataItem item = e.NewItem; item.Text += " " + (item.DataBoundItem as DataRowView)["FirstName"]; Telerik.Examples.WinControls.DataSources.NorthwindDataSet.EmployeesRow row = ((item.DataBoundItem as DataRowView).Row as Telerik.Examples.WinControls.DataSources.NorthwindDataSet.EmployeesRow); item.TextImageRelation = TextImageRelation.ImageBeforeText; item.Image = GetImageFromData(row.Photo); item.Font = new Font("Arial", 10, FontStyle.Bold); }
private void PopulateVisitList() { listVisits.Items.Clear(); List<PatientVisit> visits = new VisitData().GetVisits(_patientid); if (visits != null) { foreach (PatientVisit s in visits) { RadListDataItem item = new RadListDataItem(); item.Value = s.VisitId; item.Text = s.CreatedOn.ToShortDateString(); listVisits.Items.Add(item); } } }
private void LoadEvent(object sender, EventArgs e) { // types cmbType.Items.Clear(); String[] Types = {"Debit", "Credit"}; cmbCategories.DropDownHeight = 42; for (int i=0;i<Types.Length;i++) { RadListDataItem item = new RadListDataItem() { Text = Types[i], Value = Types[i][0], Font = new Font("Segoe UI Light", 12, FontStyle.Regular), Height = 20 }; cmbType.Items.Add(item); } cmbType.Text = "- Select -"; // category cmbCategories.Items.Clear(); AccountCategory[] categories = AccountCategory.All<AccountCategory>().Get<AccountCategory>(); for (int i = 0; i < categories.Length; i++) { RadListDataItem item = new RadListDataItem() { Text = categories[i].Title, Value = categories[i].CategoryID, Font = new Font("Segoe UI Light", 12, FontStyle.Regular), Height = 20 }; cmbCategories.Items.Add(item); } cmbCategories.Items.Add(new RadListDataItem() { Text = "Create New...", Value = -1, Font = new Font("Segoe UI Light", 12, FontStyle.Italic), Height = 20 }); cmbCategories.DropDownHeight = ((categories.Length >= 4 ? 4 : categories.Length) * 20) + 2; cmbCategories.Text = "- Select -"; }
public StartPage(EventHandler open, EventHandler newProj) { InitializeComponent(); var rss = new RssManager("http://furesoft.de/rss.php"); var feeds = rss.GetFeed(); foreach (var feed in feeds) { var item = new RadListDataItem(); item.Text = feed.Title; newsList.Items.Add(item); } _open = open; _newProj = newProj; TranslateLanguage(); }
private void PopulateSurgery() { listSurgery.Items.Clear(); listSurgery.Items.Add(new RadListDataItem() { Value = "0", Text = "New" }); List<Surgery> surgeries = new SurgeryData().GetSurgeriesForPatient(_patientid); if (surgeries != null) { foreach (Surgery s in surgeries) { RadListDataItem item = new RadListDataItem(); item.Value = s.SurgeryId; item.Text = s.SurgeryDate.ToString(); listSurgery.Items.Add(item); } listSurgery.SelectedValue = "0"; btnAddSurgery.Visible = true; btnUpdate.Visible = false; } }
private void PopulatePhotoList() { listPhotos.Items.Clear(); FileInfo[] fi = FileOperations.GetFilesinFolder(DataFolder.GetPhotoFolder(_patientid)); if (fi != null) { foreach (FileInfo f in fi) { RadListDataItem item = new RadListDataItem(); item.Value = f.FullName; item.Text = f.Name; item.TextAlignment = ContentAlignment.BottomCenter; item.Image = GetResizedImage(Image.FromFile(f.FullName)); item.TextImageRelation = TextImageRelation.ImageAboveText; listPhotos.Items.Add(item); } } if (listPhotos.Items.Count > 0) { panelPhotoView.BackgroundImage = Image.FromFile(listPhotos.Items[0].Value.ToString()); } }
public void Reload() { // Combobox AccountCategory[] categories = AccountCategory.All<AccountCategory>().Get<AccountCategory>(); cmbCategories.DropDownHeight = ((categories.Length >= 4 ? 4 : categories.Length) * 20) + 2; cmbCategories.Items.Add(new RadListDataItem() { Text = "All Categories", Value = '*', Font = new Font("Segoe UI Light", 12, FontStyle.Regular), Height = 20 }); for (int i = 0; i < categories.Length; i++) { RadListDataItem item = new RadListDataItem() { Text = categories[i].Title, Value = categories[i].CategoryID, Font = new Font("Segoe UI Light", 12, FontStyle.Regular), Height = 20 }; cmbCategories.Items.Add(item); } cmbCategories.Text = "- Select -"; cmbCategories.SelectedIndex = 0; // grid this.gridView.Rows.Clear(); // clear shit first. using (MySqlDataReader reader = LedgerAccount.All<LedgerAccount>().Get()) { this.gridView.MasterTemplate.AllowAddNewRow = false; this.gridView.MasterTemplate.AutoGenerateColumns = false; this.gridView.TableElement.BeginUpdate(); this.gridView.MasterTemplate.LoadFrom(reader); this.gridView.MasterTemplate.Columns["ID"].Width = 35; this.gridView.MasterTemplate.Columns["ID"].MaxWidth = 40; this.gridView.MasterTemplate.Columns["ID"].HeaderText = "Item"; this.gridView.MasterTemplate.Columns["ID"].TextAlignment = ContentAlignment.MiddleRight; this.gridView.MasterTemplate.Columns["AccountID"].Width = 75; this.gridView.MasterTemplate.Columns["AccountID"].MaxWidth = 75; this.gridView.MasterTemplate.Columns["AccountID"].HeaderText = "Code"; this.gridView.MasterTemplate.Columns["AccountID"].TextAlignment = ContentAlignment.MiddleCenter; this.gridView.MasterTemplate.Columns["Title"].Width = 200; this.gridView.MasterTemplate.Columns["Title"].MaxWidth = 250; this.gridView.MasterTemplate.Columns["Title"].HeaderText = "Title"; this.gridView.MasterTemplate.Columns["Title"].TextAlignment = ContentAlignment.MiddleLeft; this.gridView.MasterTemplate.Columns["Description"].Width = 300; this.gridView.MasterTemplate.Columns["Description"].HeaderText = "Description"; this.gridView.MasterTemplate.Columns["Description"].TextAlignment = ContentAlignment.MiddleLeft; this.gridView.MasterTemplate.Columns["Balance"].Width = 120; this.gridView.MasterTemplate.Columns["Balance"].MaxWidth = 120; this.gridView.MasterTemplate.Columns["Balance"].HeaderText = "Balance"; this.gridView.MasterTemplate.Columns["Balance"].TextAlignment = ContentAlignment.MiddleRight; this.gridView.MasterTemplate.Columns["Type"].Width = 80; this.gridView.MasterTemplate.Columns["Type"].MaxWidth = 80; this.gridView.MasterTemplate.Columns["Type"].HeaderText = "Type"; this.gridView.MasterTemplate.Columns["Type"].TextAlignment = ContentAlignment.MiddleCenter; this.gridView.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.gridView.TableElement.EndUpdate(); this.gridView.CurrentRow = null; } }
public void AddDec(string name, int line) { var i = new RadListDataItem { Text = name, Tag = line, Image = Resources.Properties2 }; this.radListControl1.Items.Add(i); }
public AddOrEditClassForm(DBManager dbManag, int aID) { InitializeComponent(); mDBManager = dbManag; mID = aID; var cl = from c in mDBManager.Classes where c.ID == aID select c; mClass = cl.FirstOrDefault(); this.Text = FormTitles.ClassForm.Edit; mFormState = FormState.Editing; nameTextbox.Text = mClass.Name; shortNameTextbox.Text = mClass.ShortName; long headTeacherID = -1; foreach (Teacher t in mDBManager.Teachers) { if (t.ID == mClass.HeadTeacherID) { headTeacherID = t.ID; break; } } Teacher teacher = null; foreach (var t in mDBManager.Teachers) { if (t.ID == headTeacherID) { teacher = t; } } if (teacher != null) { this.mHeadTeacher = teacher; headTeacherNameLabel.Text = this.mHeadTeacher.Name; changingHeadteacherReadyButton.Visible = false; teachersDropdownlist.Visible = false; } else { changeHeadTeacherButton.Visible = false; changingHeadteacherReadyButton.Visible = true; teachersDropdownlist.Visible = true; } if (mClass.Color != Color.Empty) { colorPanel.BackColor = mClass.Color; } else{ colorPanel.BackColor = RandomColor.GetRandomColor(); } RadListDataItem dropDownItem = new RadListDataItem("1"); dropDownItem.Value = 1; gradeDropdownlist.Items.Add(dropDownItem); for(int i = 2; i <= 12; ++i){ dropDownItem = new RadListDataItem(i.ToString()); dropDownItem.Value = i; gradeDropdownlist.Items.Add(dropDownItem); } try { gradeDropdownlist.Items[mClass.Grade - 1].Selected = true; } catch { } importTeachersFromTheDatabase(); }
private void importTeachersFromTheDatabase() { int i = 0; foreach(Teacher t in mDBManager.Teachers) { RadListDataItem item = new RadListDataItem(t.Name); item.Value = t.ID; try { if ((long)item.Value == mHeadTeacher.ID) { item.Selected = true; } } catch { } teachersDropdownlist.Items.Add(item); i++; } }
private void GetVersions(bool useexperementbuilds, bool usebetabuilds, bool usealphabuilds, bool useotherbuilds) { _oldver = Versions.Text; Versions.Items.Clear(); Versions.Items.Add(_locRm.GetString("uselastversion")); var list = new List<string>(); var json = JObject.Parse(File.ReadAllText(Variables.McFolder + "/versions/versions.json")); var jr = (JArray) json["versions"]; for (var i = 0; i < jr.Count; i++) { if (json["versions"][i] == null) continue; var id = json["versions"][i]["id"].ToString(); var type = json["versions"][i]["type"].ToString(); list.Add(string.Format("{0} {1}", type, id)); var ritem = new RadListDataItem {Text = type + " " + id, Tag = id}; switch (type) { case "snapshot": if (useexperementbuilds) Versions.Items.Add(ritem); break; case "old_beta": if (usebetabuilds) Versions.Items.Add(ritem); break; case "old_alpha": if (usealphabuilds) Versions.Items.Add(ritem); break; case "release": Versions.Items.Add(type + " " + id); break; default: if (useotherbuilds) Versions.Items.Add(ritem); break; } } foreach (var info in from b in Directory.GetDirectories(Variables.McVersions) where File.Exists(string.Format("{0}/{1}/{1}.json", Variables.McVersions, new DirectoryInfo(b).Name)) let add = list.All(a => !a.Contains(new DirectoryInfo(b).Name)) where add select JObject.Parse( File.ReadAllText(string.Format("{0}/{1}/{1}.json", Variables.McVersions, new DirectoryInfo(b).Name)))) Versions.Items.Add(info["type"] + " " + info["id"]); try { if (_oldver != null & _oldver != string.Empty) { var founded = false; foreach (var a in Versions.Items.Where(a => a.Text.Contains(_oldver))) { Versions.SelectedItem = a; founded = true; break; } if (founded != true) Versions.SelectedIndex = 0; } else Versions.SelectedIndex = 0; } catch { Versions.SelectedIndex = 0; } }
//TODO: Add modified versions private void GetVersions() { versionsDropDownList.Items.Clear(); versionsDropDownList.Items.Add(_applicationContext.ProgramLocalization.UseLatestVersion); List<string> list = new List<string>(); JObject json = JObject.Parse(File.ReadAllText(_applicationContext.McVersions + "/versions.json")); foreach (JObject ver in json["versions"]) { string id = ver["id"].ToString(), type = ver["type"].ToString(); list.Add(string.Format("{0} {1}", type, id)); RadListDataItem ritem = new RadListDataItem {Text = type + " " + id, Tag = id}; switch (type) { case "snapshot": if (snapshotsCheckBox.Checked) { versionsDropDownList.Items.Add(ritem); } break; case "old_beta": if (betaCheckBox.Checked) { versionsDropDownList.Items.Add(ritem); } break; case "old_alpha": if (alphaCheckBox.Checked) { versionsDropDownList.Items.Add(ritem); } break; case "release": versionsDropDownList.Items.Add(ritem); break; default: if (otherCheckBox.Checked) { versionsDropDownList.Items.Add(ritem); } break; } } if (otherCheckBox.Checked) { foreach (Version version in from b in Directory.GetDirectories(_applicationContext.McVersions) where File.Exists(string.Format("{0}/{1}/{1}.json", _applicationContext.McVersions, new DirectoryInfo(b).Name)) let add = list.All(a => !a.Contains(new DirectoryInfo(b).Name)) where add select Version.ParseVersion( new DirectoryInfo(string.Format("{0}/{1}/", _applicationContext.McVersions, new DirectoryInfo(b).Name)), false)) { versionsDropDownList.Items.Add(new RadListDataItem(version.ReleaseType + " " + version.VersionId) { Tag = version.VersionId }); } } if (CurrentProfile.SelectedVersion != null) { foreach ( RadListDataItem a in versionsDropDownList.Items.Where(a => a.Text.Contains(CurrentProfile.SelectedVersion))) { versionsDropDownList.SelectedItem = a; return; } } versionsDropDownList.SelectedIndex = 0; }
/// <summary> /// Loads the definitions. /// </summary> private void LoadDefinitions() { this.listParamDefinitions.Items.Clear(); foreach (var d in this.definitionList) { var item = new RadListDataItem(d.Name, d.Id); this.listParamDefinitions.Items.Add(item); if (d.Id == this.activeDefinition.Id) { this.listParamDefinitions.SelectedItem = item; } } }
private void addDefaultControlsInformationWhenEditing() { Telerik.WinControls.UI.RadListDataItem radListDataItem4 = new Telerik.WinControls.UI.RadListDataItem(); Telerik.WinControls.UI.RadListDataItem radListDataItem5 = new Telerik.WinControls.UI.RadListDataItem(); Telerik.WinControls.UI.RadListDataItem radListDataItem6 = new Telerik.WinControls.UI.RadListDataItem(); radListDataItem4.Text = "1 час"; radListDataItem4.Value = 1; radListDataItem4.TextWrap = true; radListDataItem5.Text = "2 часа"; radListDataItem5.Value = 2; radListDataItem5.TextWrap = true; radListDataItem6.Text = "без значение"; radListDataItem6.Value = 3; radListDataItem6.TextWrap = true; try { switch (mLesson.HourLenght) { case HourLenght.SingleHour: radListDataItem4.Selected = true; break; case HourLenght.DoubleHour: radListDataItem5.Selected = true; break; case HourLenght.NoMatter: radListDataItem6.Selected = true; break; } } catch { radListDataItem4.Selected = true; } this.dropDownListLessonLenght.Items.Add(radListDataItem4); this.dropDownListLessonLenght.Items.Add(radListDataItem5); this.dropDownListLessonLenght.Items.Add(radListDataItem6); foreach (Teacher t in mDBManager.Teachers) { RadListDataItem listDataItem = new RadListDataItem(); listDataItem.Text = t.Name; listDataItem.Value = t.ID; if (t.ID == mLesson.Teacher.ID) { listDataItem.Selected = true; } dropDownListTeachers.Items.Add(listDataItem); } foreach (Subject s in mDBManager.Subjects) { RadListDataItem listDataItem = new RadListDataItem(); listDataItem.Text = s.Name; listDataItem.Value = s.ID; if (s.ID == mLesson.Subject.ID) { listDataItem.Selected = true; } dropDownListSubjects.Items.Add(listDataItem); } foreach (Class c in mDBManager.Classes) { RadListDataItem listDataItem = new RadListDataItem(); listDataItem.Text = c.Name; listDataItem.Value = c.ID; if (c.ID == mLesson.Class.ID) { listDataItem.Selected = true; } dropDownListClasses.Items.Add(listDataItem); } foreach (Classroom c in mDBManager.Classrooms) { RadListDataItem listDataItem = new RadListDataItem(); listDataItem.Text = c.Name; listDataItem.Value = c.ID; try { if (c.ID == mLesson.DesiredClassroom.ID) { listDataItem.Selected = true; } } catch { } dropDownListWantedRoom.Items.Add(listDataItem); } spinEditorHoursPerWeek.Value = mLesson.HoursPerWeek; }
private void addDefaultControlsInformationWhenAddingNew() { Telerik.WinControls.UI.RadListDataItem radListDataItem4 = new Telerik.WinControls.UI.RadListDataItem(); Telerik.WinControls.UI.RadListDataItem radListDataItem5 = new Telerik.WinControls.UI.RadListDataItem(); Telerik.WinControls.UI.RadListDataItem radListDataItem6 = new Telerik.WinControls.UI.RadListDataItem(); radListDataItem4.Text = "1 час"; radListDataItem4.Value = 1; radListDataItem4.TextWrap = true; radListDataItem5.Text = "2 часа"; radListDataItem5.Value = 2; radListDataItem5.TextWrap = true; radListDataItem6.Text = "без значение"; radListDataItem6.Value = 3; radListDataItem6.TextWrap = true; this.dropDownListLessonLenght.Items.Add(radListDataItem4); this.dropDownListLessonLenght.Items.Add(radListDataItem5); this.dropDownListLessonLenght.Items.Add(radListDataItem6); foreach (Teacher t in mDBManager.Teachers) { RadListDataItem listDataItem = new RadListDataItem(); listDataItem.Text = t.Name; listDataItem.Value = t.ID; dropDownListTeachers.Items.Add(listDataItem); } foreach (Subject s in mDBManager.Subjects) { RadListDataItem listDataItem = new RadListDataItem(); listDataItem.Text = s.Name; listDataItem.Value = s.ID; dropDownListSubjects.Items.Add(listDataItem); } foreach (Class c in mDBManager.Classes) { RadListDataItem listDataItem = new RadListDataItem(); listDataItem.Text = c.Name; listDataItem.Value = c.ID; dropDownListClasses.Items.Add(listDataItem); } foreach (Classroom c in mDBManager.Classrooms) { RadListDataItem listDataItem = new RadListDataItem(); listDataItem.Text = c.Name; listDataItem.Value = c.ID; dropDownListWantedRoom.Items.Add(listDataItem); } }
public void AddDef(string name, int line) { var i = new RadListDataItem { Text = name, Tag = line, Image = Resources.VSObject_Method }; this.radListControl1.Items.Add(i); }