Skip to Content

Auto select saved value on radio button on view load.

Jan 27 at 02:19 PM


avatar image
Former Member

Dear All,

I have created an input form, I am using textboxes and radio button to input fields in my database, I need some help in Edit mode, when user opens the form, I want to select the saved value in my radio button group. I am unable to do that, please review my view and suggest,

<RadioButtonGroup columns="5"  id="rb_PC" selected="{ path: 'Item' }">
	 <RadioButton id="rb_itm1" groupName="itm1" text="Item 1"/>
	 <RadioButton id="rb_itm2" groupName="itm2" text="Item 2"/>
	 <RadioButton id="rb_itm3" groupName="itm3" text="Item 3"/>
	 <RadioButton id="rb_itm4" groupName="itm4" text="Item 4"/>
	 <RadioButton id="rb_itm5" groupName="itm5" text="Item 5"/>

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Efim Parshin Jan 29 at 09:33 AM

Hi, I don't know how you store selected value, but you should store selected index.

And as i know RadioButtonGroup control has no 'selected' property, it has 'selectedIndex'.

So in your case, if you have stored index of selected item, set it to the model, and then bind 'selectedIndex' of RadionButtonGroup to according path.

10 |10000 characters needed characters left characters exceeded