Skip to Content

Check all checkboxes in a column of a matrix using SAP BUSINESS ONE STUDIO

Hello Experts,

I am using SAP BUSINESS ONE STUDIO. I have created a matrix with a checkbox column. Is there a fast way to select all checkboxes of the column? I am currently using the following code which is rather slow(e.g 100 rows -> 7.1 seconds)

Thanks in Advance,
Nikolas


private void CheckBox0_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            Task task = new Task(() => { TurnAllCheckBoxChecked(); });
            //System.Diagnostics.Stopwatch StopWatch = new System.Diagnostics.Stopwatch();
            //StopWatch.Start();
            task.Start();
            
           // task.Wait();
           // StopWatch.Stop();
           // TimeSpan time = StopWatch.Elapsed;


        }
        private void TurnAllCheckBoxChecked()
        {
            int i = 1;
            while (i <= this.Matrix0.RowCount)
            {
                SAPbouiCOM.CheckBox CheckingBox = (SAPbouiCOM.CheckBox)Matrix0.Columns.Item(1).Cells.Item(i).Specific;
                CheckingBox.Checked = true;
                i++;
            }
        }
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 03 at 01:34 PM

    Hi,

    Instead of this, you can try to use DBDataSource for your purpose. I have provided a sample for the same in this post.

    Hope it helps!

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded