Hi Pratheep,
Thanks for contacting Syncfusion support,
Query 1: when page load the radio button default state is checked.
We have checked with your query and you can achieve your requirement by using our existing “checked” property. please refer the below code example
<ej:RadioButton Name="category" ID="Radio1" runat="server"
Checked="true" Text="1+ years" ></ej:RadioButton>
|
Query 2: in button click, need to get radio button status (true/false):
This can be achieved with help of our existing “checked” property which will return the checked state of the radio button.
Here we have used our EJ button and its click event. In this event, we get the checked state of required radio button by using instance of that required button.
Please refer the below code sample
[body]
<ej:RadioButton Name="category" ID="Radio1" runat="server" CssClass="RadioNode" Checked="true" Text="1+ years" ></ej:RadioButton>
<ej:Button ID="btn" runat="server" Type="Button" Text="Status" ClientSideOnClick="onBtnClick"></ej:Button>
[script]
function onBtnClick() { // triggers while click the ejbutton
obj = $("#<%=Radio1.ClientID%>").ejRadioButton("instance");
// instance creation for radiobutton
console.log("the radioButton checked state is : " + obj.model.checked);
// obj.model.checked – prints the checked status of the radiobutton
} |
In the above code example, we have render the first radiobutton as checked state in initial loading by setting our “checked” property as “true” and while click the ejbutton we have get the radiobutton status by using “checked” property with created instance to the radiobutton.
Please let us know if you need any further assistance.
Regards,
Sureshkumar P