[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

Checking check boxes that are automatically generated

AxaptaProgrammer

1/24/2006 7:28:00 PM

How can we progammtically check the check boxes which are automatically
generated on a form? All the check boxes have the same control name and do
not have any index value.
Is there any index property for this kind of Auto generated controls?

When we write the code
inventTransRegisterForm.AutoCreateCtrl().checked(true)
Only one check box is checked. Whereas we want to check multiple checkboxes
that are dynamically created.
We tried following workaround
Finding The serial numbers in the grid and setting the check box of that
serial number
for (i=1; i<=10; i+=1)
{

inventTransRegisterForm.CtrlTransactionsCtrl().find(inventTransRegisterForm.InventoryDimensions_inventSerialIdCtrl(),int2str(i));
inventTransRegisterForm.AutoCreateCtrl().checked(true);
}

But this code results in none of the check box as checked grid ,
When we do
inventTransRegisterForm.CtrlTransactionsCtrl().find(inventTransRegisterForm.InventoryDimensions_inventSerialIdCtrl(),'1');
shows all 15 records in the grid
3 Answers

Luegisdorf

1/25/2006 11:50:00 AM

0

Hi AxaptaProgrammer

When you add the checkboxes you can retrieve the the handle and set an
explicit name, store the name, and use it later to get access to the control.

regards
Patrick

"AxaptaProgrammer" wrote:

> How can we progammtically check the check boxes which are automatically
> generated on a form? All the check boxes have the same control name and do
> not have any index value.
> Is there any index property for this kind of Auto generated controls?
>
> When we write the code
> inventTransRegisterForm.AutoCreateCtrl().checked(true)
> Only one check box is checked. Whereas we want to check multiple checkboxes
> that are dynamically created.
> We tried following workaround
> Finding The serial numbers in the grid and setting the check box of that
> serial number
> for (i=1; i<=10; i+=1)
> {
>
> inventTransRegisterForm.CtrlTransactionsCtrl().find(inventTransRegisterForm.InventoryDimensions_inventSerialIdCtrl(),int2str(i));
> inventTransRegisterForm.AutoCreateCtrl().checked(true);
> }
>
> But this code results in none of the check box as checked grid ,
> When we do
> inventTransRegisterForm.CtrlTransactionsCtrl().find(inventTransRegisterForm.InventoryDimensions_inventSerialIdCtrl(),'1');
> shows all 15 records in the grid

David Pokluda

1/26/2006 6:13:00 PM

0

I have no experience with this type of controls but I assume you can still
use:

form.design().controlNum(_index)

where form is of type FormRun.

Regards,
David.

"AxaptaProgrammer" <AxaptaProgrammer@discussions.microsoft.com> wrote in
message news:F3BBC7C9-B8CA-4538-9D89-B0FB0D45AA57@microsoft.com...
> How can we progammtically check the check boxes which are automatically
> generated on a form? All the check boxes have the same control name and do
> not have any index value.
> Is there any index property for this kind of Auto generated controls?
>
> When we write the code
> inventTransRegisterForm.AutoCreateCtrl().checked(true)
> Only one check box is checked. Whereas we want to check multiple
> checkboxes
> that are dynamically created.
> We tried following workaround
> Finding The serial numbers in the grid and setting the check box of that
> serial number
> for (i=1; i<=10; i+=1)
> {
>
> inventTransRegisterForm.CtrlTransactionsCtrl().find(inventTransRegisterForm.InventoryDimensions_inventSerialIdCtrl(),int2str(i));
> inventTransRegisterForm.AutoCreateCtrl().checked(true);
> }
>
> But this code results in none of the check box as checked grid ,
> When we do
> inventTransRegisterForm.CtrlTransactionsCtrl().find(inventTransRegisterForm.InventoryDimensions_inventSerialIdCtrl(),'1');
> shows all 15 records in the grid


Necmi Göcek

1/30/2006 2:57:00 PM

0

FormCheckBoxControl fcbx;
int i;
;

for (i = 1; i<=10; i++)
{
fcbx = this.form().addControl(FormControlType::CheckBox, "");
fcbx.label("Check Box No: "+int2str(i));
fcbx.value(i mod 2);
}
--
_MIB_


"AxaptaProgrammer" wrote:

> How can we progammtically check the check boxes which are automatically
> generated on a form? All the check boxes have the same control name and do
> not have any index value.
> Is there any index property for this kind of Auto generated controls?
>
> When we write the code
> inventTransRegisterForm.AutoCreateCtrl().checked(true)
> Only one check box is checked. Whereas we want to check multiple checkboxes
> that are dynamically created.
> We tried following workaround
> Finding The serial numbers in the grid and setting the check box of that
> serial number
> for (i=1; i<=10; i+=1)
> {
>
> inventTransRegisterForm.CtrlTransactionsCtrl().find(inventTransRegisterForm.InventoryDimensions_inventSerialIdCtrl(),int2str(i));
> inventTransRegisterForm.AutoCreateCtrl().checked(true);
> }
>
> But this code results in none of the check box as checked grid ,
> When we do
> inventTransRegisterForm.CtrlTransactionsCtrl().find(inventTransRegisterForm.InventoryDimensions_inventSerialIdCtrl(),'1');
> shows all 15 records in the grid