multi-select

How do I mimic Windows Explorer multi-select/drag-n-drop behavior in a DataGridView?

断了今生、忘了曾经 提交于 2019-12-01 20:33:34
I'm trying to mimic the way Windows Explorer handles multiple selection. In a default DataGridView, you can select multiple items using Ctrl-click. But if you release the Ctrl key and then try and drag/drop the selected items, it clears the selected items and only selects the "hit" row. I found the following solution somewhere online. protected override OnMouseDown(MouseEventArgs e) { int hitRowIndex = HitTest(e.X, e.Y).RowIndex; if(!SelectedRows.Contains(Rows[hitRowIndex])) { base.OnMouseDown(); } } However, this causes other side effects. With the CTRL key pressed and mousing down on a

How to add option using MultiSelect jQuery plugin

一世执手 提交于 2019-12-01 19:51:40
I am using the jQuery - MultiSelect plugin. I want to be able to add an option to my initial select box, and then have the MultiSelect user interface update with the new option. Here is what I have (which doesn't work). var value = $("#newGroup").val(); $('#Select1').append("<option value=\"" + value + "\">" + value + "</option>"); Then I've tried to call the same code to recreate the multiselect along with other options like destroying it first. Here is the code I use to implement the plugin. $("#Select1").multiselect({ sortable: false, searchable: true }); Here is the plugin's home page:

Is it possible to set limit in multiple selection dropdown list?

只愿长相守 提交于 2019-12-01 19:41:56
I am using a multiple selection drop-down list in my site.This is working properly and we can select more than one options from that list.But I want select only 3 options from that list.Is it possible to set limit for that?? I am using the code from http://www.aleixcortadellas.com/main/2009/03/20/492/ use jQuery and following click function, it will help $(document).ready(function() { $('#slectboxid option').click(function() { var items = $(this).parent().val(); if (items.length > 3) { alert("You can only select 3 values at a time"); $(this).removeAttr("selected"); } }); }); Edit : use .prop()

ListBox Shift-Click Multi-Select Anchor is not being set properly

守給你的承諾、 提交于 2019-12-01 19:07:30
I’m at my wit’s end trying to figure this out. I'm experienced in WPF, but I've never seen anything like this. I have a ListBox that contains selectable ListBoxItems. Items in the list can be selected by mouse click or by using the up/down arrows. I’m using SelectionMode.Extended, so my list supports multiple selections. The problem: Clicking on an item in the list, then Shift-Clicking on another item selects the correct range of items like you would expect. Unfortunately, using the up/down arrows does not work properly – instead, the range that’s selected always seems to be based off of the

Select All mat option and deselect All

余生长醉 提交于 2019-12-01 16:11:04
问题 I have scenario as below: I want to achieve is: When user click on All then all options shall be selected and when user click All again then all options shall be deselcted. If All option is checked and user click any other checkbox than All then All and clicked checkbox shall be deselected. When user selects 4 options one by one then All shall be selected. HTML file <mat-select placeholder="User Type" formControlName="UserType" multiple> <mat-option *ngFor="let filters of userTypeFilters"

Multiselect search whole string

我是研究僧i 提交于 2019-12-01 14:25:24
I have a multiselect with search bound to a store (with attribute string_value). Search only searches strings that start with "string to search" instead of contains "string to search" (similar to searching for '%string%' instead of 'string%'). Is there a way to do this by extending 'multiselector-search'? Below is my multiselector control bound to a form: var ms = Ext.widget('form', { xtype: 'multi-selector', width: 400, height: 300, requires: [ 'Ext.view.MultiSelector' ], layout: 'fit', renderTo: Ext.getBody(), items: [{ bbar: [{ xtype: 'button', itemId: 'button', html: 'Toolbar here', text:

how to change background color of selected items in multiselect dropdown box?

时光总嘲笑我的痴心妄想 提交于 2019-12-01 04:13:40
I want to give the yellow color to the selected items in multiselect dropdown box. By default it has gray background after selecting, I want to do this in HTML, CSS . Can any one help in this? We can simply do with the help of the below css. select option:checked{ background: #1aab8e -webkit-linear-gradient(bottom, #1aab8e 0%, #1aab8e 100%); } <style> .select2-container--default .select2-results__option[aria-selected=true] { background-color: inherit; color: lightgray; } </style> Add your own style inside the block. We can use JS to select the DOMs. $('select').change(function() { $('option')

Drag-select with ListBox

核能气质少年 提交于 2019-12-01 04:02:09
问题 I have a simple implementation of a ListView in WPF that allows me to select multiple items in the list by holding the mouse button and dragging over the items. However, while holding the mouse button down, when I move the mouse outside the ListView , something strange happens with the selection. Ideally, I would just want the selection to remain the same, but instead it quickly cycles through all the selected items, leaving only the last item selected. Here's the code, have any ideas? public

Replacing Ext.reg() (xtype) in ExtJS4?

狂风中的少年 提交于 2019-12-01 02:57:20
I want to use the MultiSelect from 3.3 in Ext JS 4, as described in this previous question: Why are the Ext JS multiselect item selector files not included in the Ext JS 3.3 download and where are they? It seems like the way to register xtypes has changed in Ext JS 4. When I try to import this widget,along with ItemSelector.js, I get an error on Ext.reg(). Ext.reg('multiselect', Ext.ux.form.MultiSelect); //backwards compat Ext.ux.Multiselect = Ext.ux.form.MultiSelect; How do I change wdigets to get them to work in Ext JS 4? The Ext JS 4 way is to use the new class system to create your widget:

JList - select multiple items

。_饼干妹妹 提交于 2019-12-01 02:29:41
I faced a problem with this setSelectedValue() method in JList when I wanted to select multiple values in a JList automatically, it still selected only one. Is there a way? String[] items = { "Item 1", "Item 2", "Item 3", "Item 4" }; final JList theList = new JList(items); theList.setSelectedValue("Item 1",true); theList.setSelectedValue("Item 2",true); This code shows only Item 2 as selected. Use JList.setSelectedIndices(int[]) after calling JList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) . E.G. import javax.swing.*; import java.io.*; import java.util.ArrayList; class