selected

Datagrid.IsSelected Binding and scrolling

自作多情 提交于 2019-12-05 13:11:37
问题 I uses MVVM and I bind datagrid to collection with some code: <DataGrid ItemsSource="{Binding Entites}" AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" SelectedItem="{Binding SelectedEntity}"> And I aslo use binding to IsSelectedProperty using style (RowStyle or ItemContainerStyle) <DataGrid.RowStyle> <Style> <Setter Property="DataGridRow.IsSelected" Value="{Binding IsSelectedProperty, Mode=TwoWay}" /> </Style> </DataGrid.RowStyle> It works well. But if I scroll datagrid down

Jquery binding event on selected class

廉价感情. 提交于 2019-12-05 09:49:50
Is it achievable in jquery to bind an event to a group of control that has certain class? It seems to me, it can't. I google a bit and all that came up are nothing to do with events. Here's how my code looks - $('.numonly').bind('keypress',function(event){ if (event.which > 31 && (event.which < 48 || event.which > 57)) return false; }); Your code should work, here's an example of it in action: http://jsfiddle.net/g3GsE/ Make sure that your code is wrapped like this so it doesn't execute until document.ready : $(function() { $('.numonly').bind('keypress',function(event){ if (event.which > 31 &&

How to programmatically select RadioButton in an activity

你离开我真会死。 提交于 2019-12-05 04:40:28
In my project, I get the value of the gender from the database as 0 and 1. 0 for male and 1 for female. Based on this values, I need to check the corresponding RadioButton in a RadioGroup. If 0 is pressed, radio0 will be checked or radio1 will be checked. I don't know how to check the radio button based on this string values... This is the code I tried: String gendd=ViewProfileActivity.participantview.get(4); System.out.println("Gender:::::"+gendd); male=(RadioButton)findViewById(R.id.radio0); female=(RadioButton)findViewById(R.id.radio1); if(gendd.equals("0")){ male.setSelected(true); female

Add selected attribute to option in select menu with jQuery

北战南征 提交于 2019-12-05 03:42:27
I'm making a select menu plugin to replace the ugly default selects and be consistent across different OS. Here's the demo (only firefox and webkit) http://spacirdesigns.com/selectMenu/ It's already working, but I'm having problems assigning the "selected" attribute to the option. The code works with any other attribute but I can't get it to work with the selected attribute. This works: select.find('option') .removeAttr('whatever') .eq(index).attr('whatever', 'hello'); This doesn't: select.find('option') .removeAttr('selected') .eq(index).attr('selected', 'selected'); And here's the code so

How to keep an item selected? - ListView

穿精又带淫゛_ 提交于 2019-12-04 20:10:50
I would like to keep an item selected, on a ListView, when the user clicks on a space which has no item. For example, the space below the items, but still on the ListView component. I've change the ListView property "HideSelection" to false, but that only works when the focus is changed to another component; not when the user clicks on the ListView itself. Thanks! This is something you normally shouldn't fix. The user clicked somewhere intentionally, that might well be because she wanted to deselect an item. If it was unintentional then she'll understand what happened and know how to correct

C# Listbox set selected item

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 12:36:43
问题 i have a C# listbox with the values Profile 1 Profile 2 Profile 3 I want to have Profile 2 selected when the form loads. How do I do this? 回答1: Set the ListBox.SelectedIndex property in the Form.Shown event. For example: public Form1() { InitializeComponent(); // Adding the event handler in the constructor this.Shown += new EventHandler(Form1_Shown); } private void Form1_Shown(object sender, EventArgs e) { myListBox.SelectedIndex = 1; } 回答2: Put following code in Form.Loaded event: listBox1

How to maintain selected rows in DataGridView when mouse is held down on a cell?

醉酒当歌 提交于 2019-12-04 12:24:25
I am trying to implement row moving in a DataGridView. I want to be able to select multiple rows and click on any of the selected row's cells to begin the drag operation. The problem is that the rows become deselected when I hold the mouse down on a cell. How can I prevent this from happening? From a quick Google search, this seems to a solution for custom drag-dropping of rows. Note I just ripped the following code from the linked page, I can't vouch for its effectiveness. private Rectangle dragBoxFromMouseDown; private int rowIndexFromMouseDown; private int rowIndexOfItemUnderMouseToDrop;

Custom UI TableViewCell selected backgroundcolor swift

我们两清 提交于 2019-12-04 08:08:30
问题 I am trying to change the appearance of a custom selected TableViewCell using Swift. Do I need to do it via the designer or programmatically? I tried the following: And here is my code: @IBOutlet var tableView: UITableView! var tableData: [String] = ["One", "Two", "Three", "Four"] override func viewDidLoad() { super.viewDidLoad() // Register custom cell var nib = UINib(nibName: "vwTblCell", bundle: nil) tableView.registerNib(nib, forCellReuseIdentifier: "cell") } func tableView(tableView:

How to set multiple items as selected in ListBox?

烂漫一生 提交于 2019-12-04 06:31:55
I have one ListBox with selection mode of multiple. In code behind, I want to set some values as selected. These values are present in a ListItems[] named 'Names' . HTML code: <asp:ListBox ID="lbto" class="chosen" runat="server" Width="450px" Height="20px" SelectionMode="Multiple"> <asp:ListItem>Mandy</asp:ListItem> <asp:ListItem>Amit</asp:ListItem> <asp:ListItem>sundar</asp:ListItem> <asp:ListItem>ragu</asp:ListItem> <asp:ListItem>raju</asp:ListItem> </asp:ListBox> ListItem[] Names contains 'ragu' and 'raju' . Now, when the page loads, the ListBox should contain 'ragu' and 'raju' as selected

UIButton Highlighted State not showing when clicking over a Selected UIButton

心已入冬 提交于 2019-12-04 05:04:49
I want my UIButton to show up the highlighted state when I click over a button that is already selected. Basically in the highlighted state I apply a *.png image as my UIButton backgroundImage to give a pressed down effect. But if the button is already in the Selected State When I click over it again I just can't see the highlighted state but it goes straight to the normal state! Watch the Issue--> Video of the Issue! Help please //0 init UIButton UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x, y, aSide, aSide)]; //1 Give it a backgroundColor [button setBackgroundColor:aColor]