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

2 posts, 0 answers
  1. Fg
    Fg avatar
    1 posts
    Member since:
    Jan 2015

    Posted 11 Jan 2015 Link to this post

    In Q3 2014 control, i can not find the "CanUserFreezeColumns" method in the "RadGridView". I want to show the effect like the demo.

    '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?) 

  2. Stefan
    Stefan avatar
    2911 posts

    Posted 12 Jan 2015 Link to this post


    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;

    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.


    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.

Back to Top