Devexpress Gridcontrol Multiselect without using indicator column - devexpress

Is there any way to allow the user to do a multiple row selection just by clicking and dragging along cells within the actual grid? I.e. Without using the indicator column?

You can do that by cell using just properties by setting the following properties located in Gridview.Options
Multiselect = True
MultiSelectMode = CellSelect
UseIndicatorForSelection = False
If you need to do it by entire rows, you are stuck writing that functionality yourself using GridView.CalcHitInfo and various events.

To achieve this behavior, you need to handle the MouseDown and
MouseMove events and select rows programmatically. You also need to
enable the multi-selection feature and switch the multi-selection
mode to "CellSelect" to be able to select individual cells.
download the attached sample from this link and customize it to implement your functionality...
MultiSelect Rows & Cells simultaneously
check the following thread, which using indicator but you can customize it hiding indicator and setting select option to cellselect etc...
"mulitiselect without CTRL key" on Devexpress..
search result that help you implement that you are looking for...

Related

RadGrid Filter is showing error

In RadGrid filter , i am using
CurrentFilterFunction="Contains",AutoPostBackOnFilter="true"
Every thing is fine , But one issue I've noticed is that if the user types in the the filter text box and then clicks on the menu to select another option, the default filter is immediately applied, and what i have chosen option from menu that is not opening.
And also i don't want use "FilterDelay" because it is filtering automatically after time interval.
Here i want, When Press on Enter or Tab Buttons filter should work and when user type some text in filter textbox next click on any option from menu that will open.
Can any one give solution?
Thanks..
Well, basically with RadGrid and filtering you can't have it both ways. If you define both CurrentFilterFunction and set AutoPostBackOnFilter to true. You can't expect the filtering menu to work the way you want to. That is because AutoPostBackOnFilter will rebind the grid when the filter textbox loses focus (if the value has changed), so if you change the value of the filter textbox and then you want to select a different filter function(using the filtering menu) the grid will refresh before you get to select an item from the filtering menu. What you can do is...
Keep the CurrentFilterFunction, set the AutoPostBackOnFilter to true and then set ShowFilterIcon to false so that users can NOT select a different filtering function, or...
Keep the CurrentFilterFunction, set the AutoPostBackOnFilter to false and then set ShowFilterIcon to true so that users are able to select a different filtering function but notice that you will be dropping a functionality here as well...users will have to MANUALLY select a filtering function in order to filter the grid rather than pressing ENTER
As mentioned, you can't enable both AutoPostBackOnFilter and the filter icon at the same time otherwise you will get exactly these unexpected results

How to get the selected rows in ASPxGridView?

I have a grid with ASPxCheckBox in Data Item Template. How to get KeyFieldValue of all rows whose checkbox is checked. I am trying to do this using client-side code and do it for whole grid not on visible index. Is it possible?
Note: I cannot use simple row selection command column as I am using it for some other purpose.
if you dontuse client-side code, you should use detailrow in aspxgridview. And you must use beforeperformdataselect event. if you really need checkbox, you can add checkbox a new field in asapxgridview.

What's the best practice for generating spark radio buttons?

I have a list of radio buttons, which I want to be able to both set the value of programmatically and for the user to set the value of manually.
I have a small list of data items which I want to display as options in a list of radio buttons. The objects are stored in a model object, as is the currently selected item. The currently selected item is bound to the radiobutton group. The radio buttons are generated using a spark list.
I am having a problem setting the list programatically - whenever I set the current value on the radiobutton group to the first value in the list, all of the radio buttons are cleared, where the first one should be selected. I when checking in the debugger, I found the likely reason - there are two radiobuttons in the group that point to the same value, one of which isn't showing. My best guess is that the list control has created an extra item renderer which it is holding on to in case it needs to scroll the list.
Is there a way to create radioButtons based on an ArrayCollection without using a list? Failing that, is it possible to prevent the list from generating the extra item?
Use a DataGroup with a dataProvider (an ArrayList of objects holding data) with a custom item renderer that creates the radiobutton that you need. Add proper bindings of the data object to the radiobutton (maybe even do 2 way binding for quick saving).
In the end, I gave spark best practices the finger and used a repeater, which created the correct number of radioButtons with no extras. It may be slow, but slow iteration over a set of less than ten items is O(I don't care).

List Component that acts as if control was permanently pressed

I have a list control and i want the user to be able to select many items at a time. Thus I want it to act that if the control key is pressed while he is clicking. Eg if he clicks on a selected row it should become unselected and if he clicks on a unselected row it should become selected.
Do you have any idea how to do this?
Thanks,
Dennis
If you want to follow standard UI Precedent; then set allowMultipleSelection to true and teach your users to use the control and/or shift button to select multiple items.
If you want to select multiple items without having the using press the shift or control button you'll have to extend the List class. I did a sample a while ago using the DataGrid:
http://www.flextras.com/blog/index.cfm/2009/7/23/Flextras-Friday-Lunch--Episode-22--07032009--Auto-Select-DataGrid
http://www.flextras.com/labs/AutoSelectDataGrid/
http://www.flextras.com/labs/AutoSelectDataGrid/srcview/index.html
You can probably use the same technique with a List. But, I don't recommend this approach.

ASP:ListBox | Multi Select | Keep selected values when selecting a new one

1) Have a listbox with 3 values out of 5 selected
2) When I click to select another value without holding CTRL button, it will unselect over values
How to make it keep other selected values if new value is selected?
This is going to sound like a snide answer, but I don't mean it that way. I just like to look for the simple solutions rather than the complicated onces.
The easiest way to get a control to have the behavior you want is to use a control that has the behavior that you want, rather than modifying the behavior of an existing control.
That said, if you want a list of items where a user can select a bunch of items off the list, and don't want to have to rely on them holding control, you're using the wrong tool for the job.
Use a CheckBoxList instead of a ListBox. If you want it to be scrollable, then set it in a div of a specific height, and set the style of the div to "overflow: scroll".
If you still want to use a ListBox you should use javascript and for each click event fired, you should check if the clicked element is selected/unselected and act accordingly. It's a little bit tricky but at least it is a solution for your problem.

Resources