Example #1
0
        /// <summary>
        /// when the selection of a spreadsheet is changed, updates values of name, contents, and value of spreadsheet.
        ///
        /// </summary>
        /// <param name="sender"></param>
        private void OnSelectionChanged(SpreadsheetPanel sender)
        {
            // Get where we are in the spreadsheet
            sender.GetSelection(out int col, out int row);

            // Update name textBox
            textBoxCellName.Text = (ConvertCellName(col, row));

            // Update value textBox
            sender.GetValue(col, row, out string val);
            textBoxCellValue.Text = val;

            // Update contents textBox
            textBoxCellContents.Text = sender.GetContents(col, row);

            // Focus the input onto the contents textbox
            textBoxCellContents.Focus();

            // Sending selection changed to server via JSon
            RequestTypeSelection r = new RequestTypeSelection("selectCell", spreadsheetPanel1.ConvertCellName(col, row));
            string request         = JsonConvert.SerializeObject(r) + "\n";

            NC.SendData(request);
        }