Print Page | Close Window

How to restrict column removal?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=9791
Printed Date: 17 November 2024 at 3:06pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to restrict column removal?
Posted By: andrewg
Subject: How to restrict column removal?
Date 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?



Replies:
Posted By: wlcabral
Date Posted: 05 March 2008 at 9:01pm
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


Posted By: andrewg
Date Posted: 11 March 2008 at 2:31pm
Thanks for the info! I'll give this a shot!!


Posted By: andrewg
Date Posted: 02 April 2008 at 4:29pm
Still no luck... anyone?


Posted By: andrewg
Date Posted: 11 December 2008 at 10:48am
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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net