01-03-2018 11:54 AM - edited 02-04-2024 12:14 AM
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++;
}
}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.