This is a migrated thread and some comments may be shown as answers.

Deselecting rows using ctrl-click

5 Answers 261 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joel Sanderi
Top achievements
Rank 1
Joel Sanderi asked on 01 Dec 2008, 03:14 PM
Hello.

I have a minor issue that happens when i have selected multiple rows and want to deselect one of them. I always have to click an extra time to accomplish this, I think it is a bug.

Thanks for any help, 

Joel

5 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 04 Dec 2008, 02:18 PM
Hi Joel Sanderi,

Thank you for this question.

Actually, when you click on a selected row, it becomes unselected, but at the same time it becomes current. Since the style for the selected and the current row is one and the same in the theme, it looks like the row is still selected. The SelectedRows.Count, however, returns a correct value. We will address the theming issue in one of our next versions.

If you have additional questions, feel free to contact me.

Best wishes,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Daniel
Top achievements
Rank 1
answered on 25 Apr 2009, 05:09 AM
Hi,

We have a similar problem and it is very confusing for our end-users.
Could you please recommand some workaround for this issue?

It will be also possible to deploy our solution on machines with touch-screens.
Is there any solution for multiple selection in this case as long as the CTRL + Click is not appropiate?

Looking forward for your answers.

Thanks a lot,
Daniel
0
Daniel
Top achievements
Rank 1
answered on 25 Apr 2009, 02:36 PM
Hi,

We have a problem with SelectionChanged event (Multiselect = true). The selection of a row is signaled by the event. But if you press CTRL+Click again on the same row the expected result is that the SelectionChanged to be raised again. This doesn't happen.

Any suggestion about how to fix this is very appreciated.

Cheers,
Daniel
0
Nikolay
Telerik team
answered on 29 Apr 2009, 02:43 PM
Hello Daniel,

I admit that there is a place for improvements in our Vista (ControlDefault) RadGridView theme regarding the multiple selection of rows. I made such improvements in the attached theme. If you apply it to RadGridView, you will notice there is one style when a row is current and selected (light blue) and another style when a row is current, but not selected (darker blue). Here are the steps which I followed to make the theme:
  1. Open Visual Style Builder and load RadGridView control.
  2. In the Control Structure tree select GridTableElement and then in the Expert Mode property grid set ScrollBarThemeName to ControlDefault. This will allow you to use the predefined style of the scrollbars in your custom theme.
  3. In the Control Structure tree select GridDataRowElement and look at its state tabs.
  4. In the state tab "RowVisualState.Current or RowVisualState.CurrentSelected", delete "or RowVisualState.CurrentSelected".
  5. Make a new state tab and set its condition to RowVisualState.CurrentSelected.
  6. In the Expert Mode set appropriate visual properties.
  7. Set a ThemeName and save your theme in xml file.
  8. Load it in your application and apply it to your RadGridView. For additional information about loading a theme in a project, refer to this Knowledge Base article: Adding custom redistributable themes to your applications

As to the row selection, when you are working with a touch screens where the Ctrl+Click behavior is not appropriate, you can select a row just by clicking on it. For additional information, please refer to the sample project attached. Please note that if you use this approach, you will not be able to select rows by a translucent rectangle. 

Regarding your last question, currently, you cannot select/deselect a row right after you deselect/select it when clicking Ctrl+Click if you do not first select another row. Therefore, the SelectionChanged event is not fired. You first need to click on another row and then you will be able to select/deselect the desired row. We will improve this behavior in one of our next versions.

I hope this helps. If you have additional questions, feel free to contact me.

Regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mojtaba
Top achievements
Rank 1
answered on 22 Feb 2010, 08:23 AM
Hi Joel
I have another solution just handle CurrentRowChanging event:
private void grdGroups_CurrentRowChanging(object sender, CurrentRowChangingEventArgs e) 
        { 
            if (e.CurrentRow.IsSelected && e.NewRow.IsSelected) 
            { 
                e.Cancel = true
                e.NewRow.IsSelected = false
            } 
        } 

Tags
GridView
Asked by
Joel Sanderi
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Daniel
Top achievements
Rank 1
Mojtaba
Top achievements
Rank 1
Share this question
or