![]() |
How to restrict column removal? |
Post Reply ![]() |
Author | |
andrewg ![]() Groupie ![]() Joined: 24 September 2007 Status: Offline Points: 41 |
![]() ![]() ![]() ![]() ![]() Posted: 04 March 2008 at 11:19am |
I'd like to force the users to keep only one column at all times, doesn't matter which one. How would I go about doing this simply? What messages are sent when a column is removed from the report control?
|
|
![]() |
|
wlcabral ![]() Groupie ![]() ![]() Joined: 25 April 2007 Location: Brazil Status: Offline Points: 72 |
![]() ![]() ![]() ![]() ![]() |
I'm working with MS FOXPRO and Actvex Version, I had the same problem and I solved this creating a code in MouseDown Event, basically I change the AllowDrag property if the column is the last one...
*** ActiveX Control Event *** LPARAMETERS button, shift, x, y * Preciso fazer esta verificacao para impedir que, quando sobrar apenas UMA coluna, * a mesma seja retirada do grid. E' OBRIGATORIO UMA COLUNA * hitColumn = this.HitTest(X, Y).Column If !isnull(hitColumn) nVisibleColumns = 0 nVisibleColumn = -1 for i = 0 to this.Columns.Count -1 this.Columns.Column(i).AllowDrag = .T. if this.Columns.Column(i).Visible nVisibleColumns = nVisibleColumns + 1 nVisibleColumn = i endif next if nVisibleColumn >= 0 and nVisibleColumns=1 this.Columns.Column(nVisibleColumn).AllowDrag= .f. endif EndIf |
|
wlcabral
|
|
![]() |
|
andrewg ![]() Groupie ![]() Joined: 24 September 2007 Status: Offline Points: 41 |
![]() ![]() ![]() ![]() ![]() |
Thanks for the info! I'll give this a shot!!
|
|
![]() |
|
andrewg ![]() Groupie ![]() Joined: 24 September 2007 Status: Offline Points: 41 |
![]() ![]() ![]() ![]() ![]() |
Still no luck... anyone?
|
|
![]() |
|
andrewg ![]() Groupie ![]() Joined: 24 September 2007 Status: Offline Points: 41 |
![]() ![]() ![]() ![]() ![]() |
Bump. I still can't get this to work. Can't seem to capture the On_WM_LBUTTONDOWN() message, thought that would be a fix.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |