Sagar Bandkar

Sagar Bandkar

  • NA
  • 347
  • 49.1k

check only one checkbox when (select all) checkbox click

Dec 3 2016 1:18 AM
check only one checkbox when (select all) checkbox click in Grid.MVC
 
Javascript:-
$("#checkbox1").click(function () {
$("#checkBox").prop('checked',
$(this).prop('checked'));
});
 
 
Grid Code:-
@Html.Grid(Model).Named("Grid").Columns(columns =>
{
columns.Add()
.Titled("<input name='allChk' type='checkbox' id='checkbox1'/>")
.Encoded(false)
.Sanitized(false)
.SetWidth(30)
.RenderValueAs(c => Html.CheckBox("checked", false, new { id = "checkBox", name = "inCtrId" })).SetWidth(100);
columns.Add(c => c.vcCosCode).Titled("Country Code").Filterable(true);
}).WithMultipleFilters()
 

Answers (2)