We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to freeze columns?

Thread ID:





13849 May 12,2004 11:20 AM UTC Jun 3,2004 10:45 AM UTC WinForms 2
Tags: FAQ
Administrator [Syncfusion]
Asked On May 12, 2004 11:20 AM UTC

Hello, I have one question - how can I implement freezing of column(columns) in DataGrid - .NET . I want to imitate behaviour of freezing columns in for example Access, could you can help me. Greetings. FreeStyle557

Replied On May 12, 2004 12:25 PM UTC

If you mean not allowing the user to resize columns, see the message in the forum from a few days ago. Here's a link: http://www.syncfusion.com/forums/message.asp?MessageID=6380

Replied On June 3, 2004 10:45 AM UTC

i felt your pain. as an alternate solution: Use 2 datagrids. one on the left which shows only the freeze columns. you will need to (for both) inherit from datagrid so you can override the protected GridVScroll event handler. In the event, call the base event, and then post the ScrollEventArgs via an event. Have the freezing grid register for those events. in that event handler, call it''s base.GridVScroll event, passing the original ScrollEventArgs as the second argument. Be sure to set the datasource of the frozen grid to the one on the right''s datasource (that way, tabbing around will also maintain row context. it''s really easy to implement once you get it down, and although not beautiful, it''s functional. ===example from the scroll thrower===== base.GridVScrolled(sender, se); if(null != SrollingGridVScroll) { SrollingGridVScroll(sender, se); } ======example from the scroll catcher(frozen)== public virtual void VerticalScroll(object sender, ScrollEventArgs se) { base.GridVScrolled(sender, se); } //register VerticalScroll to handle the thrower''s VScroll event. gooood luck.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon