ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Grid row Checkbox hide based on condition
Title:
B
I
{code}
?
I need a checkbox inside a grid row, but in some rows I need to hide it based on a condition
Save Changes
Cancel
Sandeep
asked at 04 May 2023
Answers
B
I
{code}
?
Here's an example using our main demo code: @{ var chkFormat = Html.Awe().CheckBox("condChk1").Ochk().Prefix("c.(Id)").SyncScript().ToString(); // Prefix is for having an unique id on each row } <script> var frmt = @Html.Raw(DemoUtils.Encode(chkFormat)); function condChkFunc(model) { if (model.Id % 2) return ''; var res = frmt.split('.(Id)').join(model.Id); return res; } </script> @(Html.Awe().Grid("GridCondChk") .Height(350) .Url(Url.Action("GetItems", "LunchGrid")) .Columns( new Column { ClientFormatFunc = "condChkFunc", Width = 70 }, new Column { Bind = "Id", Width = 100 }, new Column { Bind = "Person" }))
Save Changes
Cancel
Omu
answered at 04 May 2023
var chkFormat = Html.Awe().CheckBox("condChk1").Ochk().Prefix("c.(Id)").SyncScript().ToString(); in above line how to add check all and uncheck all in header Html.Awe().CheckBox("ChkAll").Ochk().SyncScript().ToString() please help me out i am struck here
at 04 May 2023
Sandeep
for check/uncheck all we have a demo here: https://demo.aspnetawesome.com/GridCheckboxesDemo you can see the call to `$grid.on('change', '#ChkAll'`, this is where the event handler for this is bound
at 04 May 2023
Omu
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK