checkbox

Check All Checkbox items on DataGridView

吃可爱长大的小学妹 提交于 2019-12-22 08:28:08
问题 Here's the scenario. I have checkbox (Name:"Check All" ID:chkItems) and datagridview . And when I click on this checkbox, all checkboxes on the datagridview will also be checked. I've also added the checkbox column on the grid. DataGridViewCheckBoxColumn CheckboxColumn = new DataGridViewCheckBoxColumn(); CheckBox chk = new CheckBox(); CheckboxColumn.Width = 20; GridView1.Columns.Add(CheckboxColumn); Here is the code behind of the checkbox. There is a problem on the row.Cell private void

jQuery receiving checkbox status

家住魔仙堡 提交于 2019-12-22 08:07:53
问题 I'm changing checkbox status this way: $(this).attr("checked", 'checked'); After this I want to receive checkbox status, but I got this: $(this).attr('checked'): "checked" $(this).is(':checked'): false How this can be? P.S. Maybe I'm not correctly changing checkbox status via jQuery? 回答1: The proper way is $(this).prop('checked') to return the boolean property instead of the attribute (which is a a string). Using .prop() you can also set the checked state: $(this).prop('checked', true_or

Applying CSS rules based on input checkbox status

只谈情不闲聊 提交于 2019-12-22 06:48:23
问题 I'm currently developing a site that uses the :checked variable to apply rules to the CSS. I've got a checkbox input that when triggered, should accomplish two things. The first thing it should do is expand a div from a height of 0 to 200 when checked, and back to 0 when unchecked. I had no problems with triggering that first task. The second thing that should be accomplished upon checking the box, is a transform: rotate(45deg) of a div with a " +" in it that should rotate 45 degrees into an

grouping checkboxes and allow checking a maximum of three in each group

我们两清 提交于 2019-12-22 06:46:56
问题 I would like to have an application where a user will enter data for arbitrary individuals. each individual will have a choice of a maximum of three of six options. I want help on how to force a maximum of three choices using jquery on any indivual. here is a sample code <div id="subscriber_1"> <input type=checkbox name=national> <input type=checkbox name=international> <input type=checkbox name=business> <input type=checkbox name=entertainment> <input type=checkbox name=religion> <input type

Checkbox not working properly for IE with jquery

拜拜、爱过 提交于 2019-12-22 06:09:13
问题 I am trying using several asp.net checkboxes on a page, disabling them accordingly. <asp:CheckBox ID='chkMenuItem' runat='server' CssClass='HiddenText' Text='Test' onclick='<%#String.Format("checkChild({0});", Eval("id")) %>' /> on javascript, I am using the following code function checkChild(id) { for (i = 0; i < $("input[id*=hdnParentMenuItemID]").length; i++) { if ($('input[id*=hdnParentMenuItemID]')[i].value.split(':')[0] == id) { var childID = $('input[id*=hdnParentMenuItemID]')[i].value

bool as datasource for a CheckBox (Bool update in an other thread than the one it is impacting)

萝らか妹 提交于 2019-12-22 05:43:11
问题 I try to find how to assign a bool to a checkbox. I want that my checkbox.checked value refresh automatically when my bool data change. I know that for ComboBox there are the DataSource attribute that make it with a list but I am not able to find the equivalent with checkbox. I try with the checkBox.DataBindings but it does not seem to work.On the other hand I don't really know what mean the third attribute. checkBox.DataBindings.Add("Checked", DisableBugWatcher, "check"); I need that because

mvc3 checkbox value after submit

好久不见. 提交于 2019-12-22 05:37:10
问题 I have a form with 2 fields a dropdownlist and a checkbox. I have everything working correctly but i can not for some reason obtain the value of a checkbox if it is checked this is my code.. [HttpPost] public ActionResult view(string pick) { switch (pick) { case "Deny": // capture checkbox value here break; case "Accept": // capture checkbox value here break; } return View(); } This is my view @using (Html.BeginForm("view", "grouprequest", FormMethod.Post, new {})) { @Html.DropDownList("pick"

Java check if Checkbox is checked

安稳与你 提交于 2019-12-22 05:37:08
问题 I use: CheckboxGroup cg = new CheckboxGroup(); Checkbox c1 = new Checkbox("A", false, cg); Checkbox c2 = new Checkbox("B", false, cg); Checkbox c3 = new Checkbox("C", true, cg); To create a group of three checkboxes. Now, I want to check which one of them is checked. I use: if (c1.isSelected()) { } but this gives The method isSelected() is undefined for the type Checkbox ... Recommended solution is add cast to c1, I do so and it gives Cannot cast from Checkbox to AbstractButton ... Again, how

Group box with title as Check box

ぐ巨炮叔叔 提交于 2019-12-22 05:24:16
问题 I am using Visual Studio 6.0 (VC++ with MFC) in Windows XP platform. I am trying to create a group box with the title of the group box as a check box. My intention is this: If the check box is enabled, the controls inside the group box should be enabled; or else disabled. Is this possible to accomplish? If yes, please give me some directions. Thanks. 回答1: There are a few things you can try, depending on how true you want to stay to your idea and how much work you are prepared to put into the

DataGridView CheckBox events

夙愿已清 提交于 2019-12-22 05:09:30
问题 I'm making a DataGridView with a series of Checkboxes in it with the same labels horizontally and vertically. Any labels that are the same, the checkboxes will be inactive, and I only want one of the two "checks" for each combination to be valid. The following screenshot shows what I have: Anything that's checked on the lower half, I want UN-checked on the upper. So if [quux, spam] (or [7, 8] for zero-based co-ordinates) is checked, I want [spam, quux] ([8, 7]) un-checked. What I have so far