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

How can i use "CanUserFreezeColumns" in ui for winfroms?

1 Answer 186 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fg
Top achievements
Rank 1
Fg asked on 12 Jan 2015, 03:35 AM
In Q3 2014 control, i can not find the "CanUserFreezeColumns" method in the "RadGridView". I want to show the effect like the demo. 
http://demos.telerik.com/silverlight/#GridView/Scroll

'Telerik.WinControls.UI.RadGridView' does not contain a definition for 'CanUserFreezeColumns' and no extension method 'CanUserFreezeColumns' accepting a first argument of type 'Telerik.WinControls.UI.RadGridView' could be found (are you missing a using directive or an assembly reference?) 


1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 12 Jan 2015, 01:50 PM
Hello,

Thank you for writing.

Frozen columns (in Telerik UI for WinForms are called pinned columns) are enabled by default and the user can pin a column by right clicking a header cell in the grid and working with the "Pinned State" menu item. If you want to disable this feature for certain column, you can just remove the menu item for the specific column. This can be achieved in the ContextMenuOpening event of RadGridView. Here is an example:
void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
    GridHeaderCellElement clickedCell = e.ContextMenuProvider as GridHeaderCellElement;
    if (clickedCell != null && clickedCell.ColumnInfo.Name == "B")
    {
        for (int i = 0; i < e.ContextMenu.Items.Count; i++)
        {
            if (e.ContextMenu.Items[i].Text == "Pinned state")
            {
                e.ContextMenu.Items[i].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                return;
            }
        }
    }
}

The link you provided is for the scrolling example of the Silverlight suite. In RadGridView for WInForms by default uses the realistic scroll behavior. If you want to switch to the deferred behavior, you can set the EnableFastScrolling property to true.

I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Fg
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or