Skip to main content

ASPxClientRatingControl.SetReadOnly(value) Method

Specifies whether the control’s status is read-only.

Declaration

SetReadOnly(
    value: boolean
): void

Parameters

Name Type Description
value boolean

true to make the control read-only; otherwise, false.

Remarks

Use the SetReadOnly method to dynamically change a control’s read-only status on the client. The initial status of a control can be defined using its serverASPxRatingControl.ReadOnly property. To obtain the current control’s status on the client, use the ASPxClientRatingControl.GetReadOnly method.

Example

This part of the Voting demo illustrates how to use the ASPxRatingControl.

Here, the ASPxRatingControl‘s read only status is enabled and disabled by using the ASPxClientRatingControl.SetReadOnly method within the ASPxRatingControl‘s ASPxClientRatingControl.ItemClick and ASPxCallback‘s ASPxClientCallback.CallbackComplete client events.

The ASPxRatingControl.ClientInstanceName property value is used to access the ASPxRatingControl on the client side.

...
protected void cbVoting_Callback(object source, CallbackEventArgs e) {
    ...
    CurrentUserRatingValue = (int)ratingControl.Value;
    ...
}
See Also