Believe it or not, once users start realizing that they can reconfigure their UI, they can't get enough of it. Many users know that they can just stick the mouse at the header of the column, click to select, and drag the column around. Easy! But this can be very annoying if the result isn't appropriate for the applications—especially if they save those changes!
The problem is that sometimes you want to make sure that your users can't make dramatic changes to the layout of your datasheet. For instance, you might need to make sure that some data is always visible. Unfortunately, there's no property to fix a column in position. However, you can use the events associated with controls to get the same effect.
To control repositioning, you need to use the MouseUp event of the controls in the datasheet. Set the properties for all of the columns to a single procedure in the same way I described in the previous section (and as shown in
Figure 2), and then use the following procedure to keep the columns from wandering: