Using the GroupName property alone will not work, each switch will still receive a unique attribute for the name, since it is located on different grid lines.
One option is to manually break the switch markup using the Literal control ( example ). This will make it possible to easily group radio buttons on the client side, but it requires a bit more work to determine which button was selected during postback.
When I needed this behavior, it was easier for me to keep the radio buttons as server-side controls and just apply the w / jQuery button group. Put the RadioButton in the TemplateField, as you showed, then add this code to uncheck all the other buttons if one of them is checked:
$(document).ready(function () { // could also pass in a unique ID selector createManualRadioButtonGroupForGridView(".myGridViewClass"); }); function createManualRadioButtonGroupForGridView(gridViewSelector) { $(gridViewSelector + " input[type=radio]").change(function () { var checkedRadioButton = this; $(gridViewSelector + " input[type=radio]").each(function (e) { if (this !== checkedRadioButton) { $(this).prop("checked", false); } }); }); }
source share