/// <summary> /// Sort elements by name and display them in the data grid view /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnCharSymbols_Click(object sender, EventArgs e) { var finalElements = from q in PeriodicTable.GetAllElements() orderby q.Symbol select q; //Show data binder.DataSource = finalElements; }
/// <summary> /// Sort elements by Atomic mass and display them in the data grid view /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSortAtomic_Click(object sender, EventArgs e) { var finalElements = from q in PeriodicTable.GetAllElements() orderby q.AtomicMass select q; //Show data binder.DataSource = finalElements; }
/// <summary> /// Default blank display /// </summary> private void Blank() { UI_btnCharSymbols.Enabled = true; UI_btnSortAtomic.Enabled = true; UI_btnSortName.Enabled = true; binder.DataSource = PeriodicTable.GetAllElements(); UI_labelFeedback.Text = ""; UI_txbxMolarMassOut.Text = "Enter formula"; UI_txbxMolarMassOut.ForeColor = Color.Black; }