|
-
May 24th, 2002, 11:21 AM
#1
Thread Starter
Lively Member
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..
-
May 24th, 2002, 01:50 PM
#2
try
VB Code:
MSFlexGrid.cols = MSFlexGrid.cols+1
-
May 24th, 2002, 01:57 PM
#3
Frenzied Member
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.)
-
May 24th, 2002, 03:48 PM
#4
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|