Skip to Content
avatar image
Former Member

Auto select saved value on radio button on view load.

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"/>

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 29, 2018 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.

    Add comment
    10|10000 characters needed characters exceeded