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

Is it possible to not allow row selection?

4 Answers 1092 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 27 May 2011, 03:55 PM
I'd like to not allow a row to be selected in my gridview.  Is this possible?  Basically, I don't want any selected row background color so it appears that no row is selected.  It's fine if the row is actually selected as long as it doesn't appear to be.

Is this possible?
Tks.

4 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 27 May 2011, 04:01 PM
Hi Brian,

 

You may set the CanUserSelect property of RadGridView to False, which will disable the selection to the end-user. However you may still manipulate the selection in code-behind through examining the selected item/s.
You may read more about RadGridView's Selection mechanism in our online documentation, please follow this link.


All the best,
Vanya Pavlova
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
Brian
Top achievements
Rank 1
answered on 27 May 2011, 04:16 PM
Ok, well that got me part of the way there.  However, the first row in my grid still appears to be selected.  Here is how my grid is defined:

<telerik:RadGridView  Name="dgPatientVisitList" ItemsSource="{Binding PatientVisitList}" AutoGenerateColumns="False" 
 SelectedItem="{Binding SelectedVisit, Mode=TwoWay}" ShowGroupPanel="False" IsReadOnly="True" RowIndicatorVisibility="Collapsed" CanUserSelect="False" AutoExpandGroups="True" CanUserFreezeColumns="False" ColumnWidth="Auto"  RowLoaded="dgPatientVisitList_RowLoaded">

If I remove the 'SelectedItem' property, it makes no difference.  See the attached screen show for what I'm referring to.
0
Vanya Pavlova
Telerik team
answered on 27 May 2011, 04:23 PM
Hello Brian,

 

Since the SelectedItem (which is the data item) is not synchronized with the curren item the first row should not be selected. You should set the IsSynchronizedCurrentItem property of RadGridView to False should resolve the issue. 


Best wishes,
Vanya Pavlova
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
Brian
Top achievements
Rank 1
answered on 27 May 2011, 05:33 PM
That did it!

Thanks for the quick replies!
Tags
GridView
Asked by
Brian
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Brian
Top achievements
Rank 1
Share this question
or