This project is read-only.

How to stop row and column resizing

Apr 17, 2009 at 5:13 PM
I want to stop the user from resizing the columns and rows by dragging the headers.  Is there a way of stopping this but still allowing me to programatically resize them?

I tried adding
            SourceGrid.Cells.Controllers.Resizable resizableController = new SourceGrid.Cells.Controllers.Resizable(CellResizeMode.None);
            this.Controller.AddController(unselectableController);
but that hasn't stopped it

Thanks
Apr 19, 2009 at 4:49 PM
You are going right direction. Here's what you need:

Some cells already have resizable controller. For example, Header cell already has it, and this actually exposes a property ResizeEnabled, which does what you want. Interanlly, that propery is finding a Resizble controller, and settings that controllers property to false.


You can modify sample 17 with these lines to achieve what you want:

grid1[r,0] = new SourceGrid.Cells.RowHeader("Header " + r.ToString());
SourceGrid.Cells.RowHeader header = grid1[r, 0] as SourceGrid.Cells.RowHeader;
header.ResizeEnabled = false;