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

[Solved] Setting CanUserSelect=false disables 'Select All' GridViewSelectColumn functionality

7 Answers 478 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
keith schaefer
Top achievements
Rank 1
keith schaefer asked on 26 Oct 2010, 05:06 PM
Hi,

We recently deployed version 2010.2.924.1040 (Q2) of the Web UI Silverlight tools.  In the previous version 2010.1.603.1040, when we set CanUserSelect=false, with SelectionMode=Extended or Multiple, selecting the 'Select All' checkbox in the GridViewSelectColumn header would select all of the records on the page.  Now with the Q2 version, 'select all' no longer selects all the records, nor does it deselect all the records when I uncheck it.  The first time I load the page, clicking 'select all' only selects the first record (regardless if IsSynchronizedWithCurrentItem is true or false).  To the contrary, if I individually select/check each record, 'select all' gets checked when i select all of the records and it unchecks itself as soon as I deselect one. 

This appears to be a bug.  I can attach a sample project demonstrating this behavior if necessary but here is the code from my xaml and code behind:

XAML:
<UserControl x:Class="RadGridTestApp_DELETEME.MainPage"
    xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    mc:Ignorable="d"
    d:DesignHeight="300" 
    d:DesignWidth="400">
  
    <Grid x:Name="LayoutRoot" Background="White">
        <telerikGrid:RadGridView
                Name="Results"
    CanUserSelect="False"             
    SelectionMode="Multiple" >
              
            <telerikGrid:RadGridView.Columns>
                <telerikGrid:GridViewSelectColumn x:Name="SelectColumn"/>
                <telerikGrid:GridViewDataColumn Header="TEST COLUMN" 
                                                IsReadOnly="True" 
                                                DataMemberBinding="{Binding TestValue}" />
            </telerikGrid:RadGridView.Columns>
        </telerikGrid:RadGridView>
    </Grid>
</UserControl>


Code Behind:
using System.Collections.Generic;
using System.Windows.Data;
  
namespace RadGridTestApp_DELETEME {
    public partial class MainPage {
        public MainPage() {
            InitializeComponent();
  
            var entityList = new List<ListItem> {
                                        new ListItem { TestValue = "ABC" }, 
                                        new ListItem { TestValue = "DEF" }
                                    };
  
            Results.ItemsSource = new PagedCollectionView(entityList);
        }
    }
  
    public class ListItem {
        public string TestValue { get; set; }
    }
}

7 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 02 Nov 2010, 10:43 AM

Hi keith schaefer,

Thank you for reporting this problem we will fix it right away and the fix will be available this Friday with our latest Internal Build.



Best wishes,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Chris
Top achievements
Rank 1
answered on 21 Jan 2011, 05:01 PM
Q: Did this issue get resolved?

I ask becuase even though I set the GridViewSelectColumn  column to read only and the grid itself .CanUserSelect = false the user can still select rows!
0
Yordanka
Telerik team
answered on 24 Jan 2011, 12:09 PM
Hi,

This is expected behavior when GridViewSelectColumn is used. The purpose of this column is to allow users to select items by clicking the check box in it. This special column has its own logic for selecting items which does not respect CanUserSelect property. Can you please provide more information about the scenario you want to achieve ?
 
Best wishes,
Yordanka
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Chris
Top achievements
Rank 1
answered on 24 Jan 2011, 01:12 PM

I find that a ridiculous statement.

If the column definition is within the grid then it should respect the "Can User Select Rows" property. What are the alternatives to make the select column read-only since it does not work properly at this time?
0
Vlad
Telerik team
answered on 24 Jan 2011, 01:22 PM
Hi,

 Can you clarify how selection is related to read-only grid setting? Are you looking for GridViewCheckBoxColumn?

Regards,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Chris
Top achievements
Rank 1
answered on 24 Jan 2011, 01:39 PM
You're making this too difficult. Any column in the grid should respect the CanUserSelectRows and IsReadOnly at the grid level. Since that is nnot working whjat are the alternatives?
0
Dean Wyant
Top achievements
Rank 1
answered on 31 Jan 2011, 07:39 PM
If you do not want the select column to select rows by checkbox, perhaps you should remove it from the grid?
If IsReadOnly for the column is not working as you would like, perhaps the column's cell's IsReadOnly or IsEnabled will work?
I do not know much about it, but since there has not been an answer... it is worth a try.


Tags
GridView
Asked by
keith schaefer
Top achievements
Rank 1
Answers by
Milan
Telerik team
Chris
Top achievements
Rank 1
Yordanka
Telerik team
Vlad
Telerik team
Dean Wyant
Top achievements
Rank 1
Share this question
or