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

How to lock first column to prevent it's shifting?

4 Answers 108 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Valdo
Top achievements
Rank 1
Valdo asked on 29 Sep 2011, 01:52 PM
Hi! I need to allow reordering of columns in my grid, but I want first column to remain always first, i.e. user cannot insert any column before it. Is there any way I can do this?

PS I tried interactive mode and ColumnsReordering event to cancel it, but e.Column.DisplayIndex is already equals to e.NewDisplayIndex in that case and e.Cancel doesn't affect anything.

4 Answers, 1 is accepted

Sort by
0
Frank
Top achievements
Rank 2
answered on 30 Sep 2011, 02:34 PM
Try adding

FrozenColumnCount ="1"
to the XAML for the grid control, this should freeze the first column. it works from left to right.

Frank

 

 

0
Valdo
Top achievements
Rank 1
answered on 30 Sep 2011, 02:59 PM
FrozenColumnCount is completely different thing. It only affects scrolling. And i need reordering which is performed by user.
0
Frank
Top achievements
Rank 2
answered on 30 Sep 2011, 03:06 PM
i just tryied this and it seems to work put

IsReorderable = "False"
on the first column

Frank

 

 

 

0
Valdo
Top achievements
Rank 1
answered on 30 Sep 2011, 03:37 PM
Try to drag it before first column, not on top of it. It doesn't work.
PS> Don't forget to set reorder mode = Interactive for the grid.
Tags
GridView
Asked by
Valdo
Top achievements
Rank 1
Answers by
Frank
Top achievements
Rank 2
Valdo
Top achievements
Rank 1
Share this question
or