diff --git a/knowledge-base/radiogroup-readonly.md b/knowledge-base/radiogroup-readonly.md new file mode 100644 index 000000000..27c39aea4 --- /dev/null +++ b/knowledge-base/radiogroup-readonly.md @@ -0,0 +1,78 @@ +--- +title: Readonly RadioGroup +description: Learn how to make the Telerik RadioGroup for Blazor readonly without graying out the text. +type: how-to +page_title: How to Customize Telerik RadioGroup for Blazor to Be Readonly Without Graying Out +meta_title: How to Customize Telerik RadioGroup for Blazor to Be Readonly Without Graying Out +slug: radiogroup-kb-readonly +tags: radiogroup, blazor, readonly +res_type: kb +ticketid: 1690650 +--- + +## Environment + + + + + + + + +
ProductRadioGroup for Blazor
+ +## Description + +I want to make the [RadioGroup](slug:radiogroup-overview) readonly but keep the text visually clear (not grayed out). Using the `Enabled` property disables the input entirely but also makes the text and radio buttons gray, which reduces readability. + +## Solution + +To make the TelerikRadioGroup readonly without graying out the text, use the following CSS approach: + +````Razor + + +Chosen delivery method: @(ChosenDeliveryMethod == 0 ? "no selection yet" : ChosenDeliveryMethod.ToString()) +
+ + + + +@code { + private int ChosenDeliveryMethod { get; set; } + + private List DeliveryOptions { get; set; } = new List + { + new DeliveryMethodModel { MethodId = 1, MethodText = "Standard Shipping" }, + new DeliveryMethodModel { MethodId = 2, MethodText = "Express Shipping" }, + new DeliveryMethodModel { MethodId = 3, MethodText = "In-Store Pickup" }, + new DeliveryMethodModel { MethodId = 4, MethodText = "Curbside Pickup" }, + }; + + public class DeliveryMethodModel + { + public int MethodId { get; set; } + public string MethodText { get; set; } + } +} +```` + +## See Also + +* [RadioGroup Documentation](slug:radiogroup-overview) +* [CSS pointer-events Property](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events) +* [RadioGroup Binding](slug:radiogroup-databind)