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

How to freeze the column their position itself

7 Answers 213 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rangadurai
Top achievements
Rank 1
Rangadurai asked on 15 Sep 2012, 12:02 PM
Hi,

how to se freezecolumn in gridview. if i using pinned state column goes left or right side ,i don't want like that. Have to freeze column the actual position of the column. Please help on this.

7 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 17 Sep 2012, 12:59 PM
Hi,

You can use the AllowReorder property of a column to determine whether the column can or cannot be reordered:
radGridView1.Columns["YourColumnName"].AllowReorder = false;

I hope that you find this information useful.
 
Greetings,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Rangadurai
Top achievements
Rank 1
answered on 17 Sep 2012, 02:32 PM
Hi Stefan,


Thanks for you help.
your suggestion is not working. Please have look my code.

 gv_CPS.Columns("MOLD POSITION").Width = 75
 gv_CPS.Columns("MOLD POSITION").AllowReorder = false

After that i pinned using context menu then column comes left side of the grid. I need keep column that position itself while scroliing.

In this context menu has only "pin at left","pin at right","unpin column" when i select pin at left means column comes left hand side of the grid. I don't like that manner,column keep that position itself.

Please help me on this.
0
Stefan
Telerik team
answered on 20 Sep 2012, 10:56 AM
Hello Rangadurai,

I will need some clarification on your requirements:

After that i pinned using context menu then column comes left side of the grid. I need keep column that position itself while scroliing.  
From this sentence I understand that you want to keep the "MOLD POSITION" column pinned to the left. 

In this context menu has only "pin at left","pin at right","unpin column" when i select pin at left means column comes left hand side of the grid. I don't like that manner,column keep that position itself. 

However, in this sentence you mention that you don't want it pinned to the left. So do you want it pinned to the left or not? 
 
Regards,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Rangadurai
Top achievements
Rank 1
answered on 20 Sep 2012, 03:21 PM
Hi Stefan,

Sorry for the confusion.

Don't want "mold position" column left side or right side of the grid. I want keep mold position column their position itself.

Thanks for support.
0
Stefan
Telerik team
answered on 25 Sep 2012, 08:29 AM
Hello,

So, in additiona to disabling the reorder of the column you want to prevent the user from pinning it. This can be achieved by hiding the pin option from the context menu:
Private Sub gvBarcodeGen_ContextMenuOpening(sender As Object, e As Telerik.WinControls.UI.ContextMenuOpeningEventArgs) Handles gvBarcodeGen.ContextMenuOpening
       If gvBarcodeGen.CurrentColumn.Name = "bench" Then
           For Each item As RadMenuItemBase In e.ContextMenu.Items
               If item.Text = "Pinned state" Then
                   item.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
                   Return
               End If
           Next
       End If
   End Sub

I hope this helps.
 
All the best,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Rangadurai
Top achievements
Rank 1
answered on 25 Sep 2012, 02:04 PM
Hi Stefan,

Sorry stefan,

User allow to pinning the "Bench" Column.After user pinned it goes left side of the grid i don't want this behavior.I want Pinned column at their position itself.

Thanks for support.
0
Stefan
Telerik team
answered on 27 Sep 2012, 01:20 PM
Hi,

If I understand correctly, you want to pin a column at its own position. If this is the case, it is not supported by RadGridView. A column can be pinned only to the left of right side of the grid and scrolling does not move the column. 

I hope this helps.

Regards,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Rangadurai
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Rangadurai
Top achievements
Rank 1
Share this question
or