This is a migrated thread and some comments may be shown as answers.
RadioButton in Template Column
2 Answers 199 Views
This is a migrated thread and some comments may be shown as answers.
Vaishali
Top achievements
Rank 1
Vaishali asked on 27 Jul 2012, 03:11 PM
I am trying to add radio button in a template column of the grid -

columns.Bound(r => r.Approved)
    .ClientTemplate(" <input type='radio' id='Approve' name='chkApprove' /><input type='radio' id='Deny' name='chkDeny' />")
    Title("Approve");

But the radion buttons show up as a single checkbox control. Can anyone help me with this?

 

 

 


2 Answers, 1 is accepted

Sort by
0
Vaishali
Top achievements
Rank 1
answered on 27 Jul 2012, 05:27 PM

Got the Template column working but I want to show two RadioButtons - Approve and Deny
How can I do that? Also how can I display text for those radio buttons?

columns.Template(r => @Html.RadioButton("Approve", true, false, new { @id ="Approve" }))
  .Title("Approve");

 

 

 

 

 

 

 

0
Vaishali
Top achievements
Rank 1
answered on 27 Jul 2012, 06:01 PM
Got it working

columns.Template(r =>

{

%>

<%

 

= Html.RadioButton("Approve", "true", false, new { @id = "yes_Approve" })%><label for="yes_Approve">Approve</label>

<%

 

= Html.RadioButton("Approve", "false", false, new { @id = "no_Approve" })%><label for="no_Approve">Deny</label>

<%

}).Title(

 

"Approve");

Tags
Grid
Asked by
Vaishali
Top achievements
Rank 1
Answers by
Vaishali
Top achievements
Rank 1
Share this question
or