Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - How to restrict column removal?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to restrict column removal?

 Post Reply Post Reply
Author
Message
andrewg View Drop Down
Groupie
Groupie


Joined: 24 September 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote andrewg Quote  Post ReplyReply Direct Link To This Post Topic: How to restrict column removal?
    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?
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
andrewg View Drop Down
Groupie
Groupie


Joined: 24 September 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote andrewg Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2008 at 2:31pm
Thanks for the info! I'll give this a shot!!
Back to Top
andrewg View Drop Down
Groupie
Groupie


Joined: 24 September 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote andrewg Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2008 at 4:29pm
Still no luck... anyone?
Back to Top
andrewg View Drop Down
Groupie
Groupie


Joined: 24 September 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote andrewg Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.234 seconds.