// ExEnd:HandlingButton

        // ExStart:HandlingCheckbox
        // Implenting CellCheckedChanged event handler
        private void gridDesktop1_CellCheckedChanged(object sender, CellControlEventArgs e)
        {
            // Getting the reference of the CheckBox control whose event is triggered
            Aspose.Cells.GridDesktop.CheckBox check = (Aspose.Cells.GridDesktop.CheckBox)gridDesktop1.GetActiveWorksheet().Controls[e.Row, e.Column];

            // Displaying the message when the Checked state of CheckBox is changed
            MessageBox.Show("Current state of CheckBox is " + check.Checked);
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            // ExStart:AccessCheckbox
            // Accessing the worksheet of the Grid that is currently active
            Worksheet sheet = gridDesktop1.GetActiveWorksheet();

            // Accessing cell control in the column and typecasting it to CheckBox
            Aspose.Cells.GridDesktop.CheckBox cb = (Aspose.Cells.GridDesktop.CheckBox)sheet.Columns[2].CellControl;

            if (cb != null)
            {
                // Modifying the Checked property of CheckBox
                cb.Checked = true;
            }
            else
            {
                MessageBox.Show("Please add control before accessing it.");
            }
            // ExEnd:AccessCheckbox
        }