Pivotal API provides a method SetControlReadOnly(PivotalControl) of the PivotalClientFormControl class which Sets the control as read-only during run time.
There isn’t any method to revert back the changes done by the above method.
This can be accomplished by type casting the control into the class which inherits the PivotalControl class.
Follow up:
In the below code snippet, the control is type cast into the PivotalTextBox class which inherits PivotalControl class.
PivotalTextBox _auctionAmount = FormControl.GetControlByName( "AuctionAmount" ) as PivotalTextBox;
//set the AuctionAmount field in the form as ReadOnly.
_auctionAmount.ReadOnly = true;
//Revert back the above change
_auctionAmount.ReadOnly = false;
Only the following class objects can be used to set the Read-Only attribute of the form control during Run Time.
- PivotalNumber
- PivotalMaskedTextBox
- PivotalPassword
- PivotalTextBox
- PivotalFax
- PivotalAttachment
- PivotalEmail
- PivotalWebsite
- PivotalForeignKey
- PivotalPhone
<Contributed by Nimit Sharma (GrapeCity India)>
1 comment:
Thank you it was a great support, now to make fields read-only at runtime is without a doubt very easy with the help of your advice. Kudos
Post a Comment