radio-button

How can I set the XAML for the first WPF RadioButton in a ListView control to be checked by default?

大憨熊 提交于 2019-12-22 05:58:25
问题 I have a WPF ListView control containing a number of RadioButton controls using data binding. I'd like the first RadioButton in the group to be checked by default, preferably set in the XAML rather than programmatically, but haven't managed to achieve this. My XAML for the control is: <ListView ItemsSource="{Binding OptionsSortedByKey}" > <ListView.ItemTemplate> <DataTemplate DataType="{x:Type Logging:FilterOptionsRadioListViewModel}"> <RadioButton Content="{Binding Value}" /> </DataTemplate>

Clear dropdown selection on radio button click

倾然丶 夕夏残阳落幕 提交于 2019-12-22 05:52:07
问题 I have a set of radio buttons. When primary is selected, the Primary Company field is hidden. I would also like to at this time clear the drop down selection. How can I do this? <p> <label>Company Type:</label> <label for="primary"><input onclick="javascript: $('#sec').hide('slow');" type="radio" runat="server" name="companyType" id="primary" checked />Primary</label> <label for="secondary"><input onclick="javascript: $('#sec').show('slow');" type="radio" runat="server" name="companyType" id=

JQuery UI object button bar that works like radio buttons

旧巷老猫 提交于 2019-12-22 05:41:09
问题 I'd like to make a control or use a control in jQuery that acts like a series of radio buttons but that looks like solid buttons instead of the radio circle. They'd look like a horizontal menu but only one could be selected at one time. 回答1: jQuery UI added a widget for this in 1.8, check out jQuery UI Buttons. The markup looks like this (straight from the demo), just use a container like a <div> : <div id="radio"> <input type="radio" id="radio1" name="radio" /><label for="radio1">Choice 1<

RadioButton not drawing background correctly

旧巷老猫 提交于 2019-12-22 04:57:37
问题 Alright, I'm at my wits end with this one. I am using an open-source piece of code for segmented radio buttons (https://github.com/makeramen/android-segmentedradiobutton) and it's working great, except for the few devices where it won't draw the radio buttons correctly. This is how it should look like: And this is what it's looking like on the Xperia X10 and Acer Liquid E: I have been Googling for an answer and still have no luck so I thought I would come here and see if anyone had any idea

Radio button checked by default when using ng-repeat

天大地大妈咪最大 提交于 2019-12-22 04:10:28
问题 I have been wanting to have a radio button checked out of a list of radio buttons that I present in the screen using ng-repeat, but my code does not work. This is what I am doing: <div class="clubRole" data-ng-if="club.checked"> <div data-ng-repeat="role in securityGroups.slice(0,1)"> <input type="radio" class="clubRole" data-ng-model="club.role" data-ng-value="role.securityGroupCode" checked="checked"> {{role.description}} </div> <div data-ng-repeat="role in securityGroups.slice(1

ASP.Net c# Which radio button in a given GroupName is selected?

隐身守侯 提交于 2019-12-22 03:37:07
问题 I have 30 individual RadioButtons. I can not use a RadioButtonList. There are 3 groups of buttons. Each group has a unique GroupName. Everything works properly in the web browser. How can i tell on a post back which button is selected within each of the given GroupsNames? EDIT: the function i used private string getRadioValue(ControlCollection clts, string groupName) { string ret = ""; foreach (Control ctl in clts) { if (ctl.Controls.Count != 0) { if (ret == "") ret = getRadioValue(ctl

AngularJS - 3-button group acting as radio buttons

落花浮王杯 提交于 2019-12-22 03:20:57
问题 Using the Ionic framework, I'm trying to create a group of three buttons that act as radio buttons: If I click on Breakfast, I would like Lunch and Dinner to return to their normal (white) state, and Breakfast to turn Blue. With my current code, I can't get this functionality to work, although I can get the buttons to switch color, slightly randomly (perhaps I just don't understand the ng-class directive). Here is my HTML code: <div class="bar bar-subheader"> <div class="button-bar"> <a class

Using radio button in custom listview in Android

旧街凉风 提交于 2019-12-22 00:36:08
问题 I have a custom listview which is done with getView. It must be 4 textview and a radiobutton on the right in each row. I saw many examples about this here but couldn't get the idea. Here is my getView function. With this situation i can see the rows but radiobuttons are still checked when i choose another radiobutton. What should i have to add to the function to make radiobuttons work properly and get Id of the selected one? Thanks private static class CitizenAdapter extends BaseAdapter {

Javascript Radiobutton Group Validation

时间秒杀一切 提交于 2019-12-22 00:24:25
问题 I would like your help to develop a javascript function to validate if one of the following radiobutton group (IDType) is selected and which value is checked and view error message in (ValidationError) division in case no radio button selected ?? <td> <div> <span> <input type="radio" name="IDType" id="IDType" value="IDtype1"/> ID Type 1 <input type="radio" name="IDType" id="IDType" value="IDtype2"/> ID Type 2 </span> <div id="ValidationError" name="ValidationError">   </div> </div> </td>

Radiobuttonlist event not always firing

♀尐吖头ヾ 提交于 2019-12-21 20:33:56
问题 I have a radiobuttonlist with a selectedindexchanged event that updates a search function. One of the items is specified in the aspx, and the others are appended databound items. No matter what I set as the default, that item will not fire the event. All other items will fire the event. Also, it seems that after the "dead" item is selected, the event won't fire at all. How can I track down the error and correct? Here is current code. EDIT: Sorry if the short version was misleading. I wasn't