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.
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:
THthomasJune 3, 2004 05:45 AM
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=====
if(null != SrollingGridVScroll)
======example from the scroll catcher(frozen)==
public virtual void VerticalScroll(object sender, ScrollEventArgs se)
//register VerticalScroll to handle the thrower''s VScroll event.