Results 1 to 4 of 4

Thread: Inserting a column in an MSFlexGrid

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Posts
    83

    Question Inserting a column in an MSFlexGrid

    I know how to insert a row in an MSFlexGrid using the AddItem property, but I can't seem to find a way to insert a column.

    I am using the MSFlexGrid with an overlayed text box control to do my edits.

    Here's what I'm looking for:

    Upon the Click event of a command button, I want a new column to be added to the left of wherever my current location is in the grid.

    I will also be looking for some type of similar delete column fuctionality, but I am sure if I can get an understanding of how to insert a column, delete should be a snap.

    Thanks..

  2. #2
    DeadEyes
    Guest
    try
    VB Code:
    1. MSFlexGrid.cols = MSFlexGrid.cols+1

  3. #3
    Frenzied Member John McKernan's Avatar
    Join Date
    Jan 2002
    Location
    SE PA
    Posts
    1,295
    There's no intrinsic way to insert a column at a specified location, DeadEyes' method would add the column to the end.

    I've used this method:
    1. record the column the user is already in
    2. add a column at the end
    3. move all columns left of the recorded position left one column

    This is best done with the .TextMatrix property, and I would first turn the grids .Redraw property to False and reset it when done. (I've used this on gird with a relatively few number of rows.)

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Posts
    83

    Talking

    John M.

    Took your root. Seems to work just fine. Surprising that a property does not exist to avoid this type of coding.

    Dead Eyes, I've used that property to add columns. Unfortunately inserting them is another ballgame.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width