cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos
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++;
            }
        }

Accepted Solutions (0)

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

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