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

Two questions - Freezable columns and row selection when certain cells are clicked

5 Answers 98 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 29 Jun 2009, 06:39 AM
I've got two separate questions:

1.  I don't want the user to be able to set columns as freezable, but I'd like to be able to specify certain columns in the template to be frozen by default.  Is there a property I can set on the column to do this in xaml?  I couldn't find anything obvious.

2.  When clicking on a row in the grid, I only want to select the row when certain cells within the row are clicked.  What's the best way to achieve this?

5 Answers, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 1
answered on 29 Jun 2009, 07:00 AM
Don't worry about question 2 - I've figured it out.  Here's the code if anyone is interested:

        private bool SelectionChanging = false
        private void JobListGrid_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e) 
        { 
            if (!SelectionChanging && JobListGrid.CurrentCell != null && JobListGrid.CurrentCell.Column.Name != "JobNumber" 
                && JobListGrid.CurrentCell.Column.Name != "CallSheetImage"
            { 
                SelectionChanging = true
                // Unselect the row and reselect the last row 
                foreach (Record newRec in e.AddedRecords) 
                { 
                    newRec.IsSelected = false
                } 
                foreach (Record oldRec in e.RemovedRecords) 
                { 
                    oldRec.IsSelected = true
                } 
                SelectionChanging = false
            } 
        } 

If there's a better way to do this let me know!
0
Vlad
Telerik team
answered on 29 Jun 2009, 12:20 PM
Hello Dan,

You can set CanUserFreezeColumns to false and desired FrozenColumnCount to achieve this. Here is an example:

<telerik:RadGridView Name="RadGridView1" CanUserFreezeColumns="False" FrozenColumnCount="2" />

Best wishes,
Vlad
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
Dan
Top achievements
Rank 1
answered on 29 Jun 2009, 01:23 PM
Hi Vlad

Thanks for the reply!

Is it possible to have frozen columns at both the left and right hand side of the grid?  In my case, I want to freeze the first two columns and the last column, and then allow the user scroll between the columns in the middle.
0
Vlad
Telerik team
answered on 29 Jun 2009, 01:25 PM
Hello Dan,

Currently RadGridView does not support this however we will do our best to provide this as soon as possible.

Regards,
Vlad
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
Henri
Top achievements
Rank 1
answered on 05 Jan 2012, 02:49 PM
Hello,
Is there a way yet, to freeze columns on the right hand side of the RadGridView?
Tags
GridView
Asked by
Dan
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 1
Vlad
Telerik team
Henri
Top achievements
Rank 1
Share this question
or