Solved

how to make a col invisible in msflexgrid control at run time

Posted on 2001-09-17
9
214 Views
Last Modified: 2007-12-19
hi
 i have taken a msflexgrid control and i assigned 9 cols to it at design time but at run time i want to make col 6 invisible. i tried but not got thru.
navin
0
Comment
Question by:janikhel
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6486851
u cant make it that way.
U can do it the other way.
Make 3 cols only and when u need 9 make it 9

I will send my code

just copy and paste
'first procedure make it 3 cols if u want
Call InitializeGrid(fgridfee, 4, 10, "No", "Name", "Frequency", "Amount", "FromDate", "LastDate", "Fine", "FineAmount", "Month", "Total")

'make size o0f all the cells
Call SetCellSize(fgridfee, 350, 1800, 1100, 800, 1200, 1200, 500, 1000, 1000, 1000)

Public Sub InitializeGrid(grd As MSFlexGrid, nrows As Integer, ncols As Integer, ParamArray colnames() As Variant)
''To Initialize Flex Grid
Dim i As Integer
With grd
    .Rows = nrows
    .Cols = ncols
    .FixedCols = 0
    .Row = 0
    For i = 0 To UBound(colnames)
    .Col = i
    .Text = colnames(i)
    Next i
End With
End Sub
'this procedure has to be used after InitilizeGrid function
Public Sub SetCellSize(grd As MSFlexGrid, ParamArray size() As Variant)
Dim colcount As Integer
Dim i As Integer
colcount = grd.Cols
With grd
    For i = 0 To UBound(size)
    .Col = i
    .ColWidth(i) = CInt(size(i))
    Next i
End With

End Sub
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6486861
a)Thatz is just a sample
for ur requirement

1)                          
Call InitializeGrid(fgridfee, 4, 3, "No", "Name","age" )

'make size 0f all the cells
Call SetCellSize(fgridfee, 350, 1800,1000)

'if u want to change the number of columns then

2)use grid's clear function to clear it.
3)reinitialize by calling the same method
'make 9 cols selecting the 3rd parameter to 9
'call setcellsize for those 9  cols

Call InitializeGrid(fgridfee, 4, 9, "No", "Name", "age", "Amount", "FromDate", "LastDate", "Fine",
"FineAmount", "Month")

'make size o0f all the cells
Call SetCellSize(fgridfee, 350, 1800, 1100, 800, 1200, 1200, 500, 1000)



'this should solve ur problem
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6486922
Simply set colWidth to 1

grid.ColWidth(6)=1
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Accepted Solution

by:
Zorxx earned 50 total points
ID: 6486943
What I always use is setting the width of the col to 0.. If you want to show the col then set its width back.
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6488884
Hi Zorxx
U R right as I said !!!!
0
 

Expert Comment

by:Zorxx
ID: 6489512
Sorry Bahnas, I didn't read your answer
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6491214
The Asker

Questions  
Questions Asked 7
Last 10 Grades Given  
Question Grading Record 0 Answers Graded / 0 Answers Received
Answers  
Questions Answered 2
Last 10 Grades Received A A  


Zorxx  Do not be so sorry  the asker will decide about points soon !!!!!!  nice 2 meet U



1 09/18/01 50 how to fix a position of a control like textbox in... UnlockedQ
2 09/17/01 50 how to make a col invisible in msflexgrid control ... LockedQ
3 09/08/01 50 how to edit a cell in msflexgrid control UnlockedQ
4 09/06/01 50 How to edit a unbound column in a datagrid control UnlockedQ
Active Server Pages (ASP)
# Date Pts Title Type
5 05/30/01 50 To fill one dropdownlist on selection of another d... UnlockedQ
PHP
# Date Pts Title Type
6 07/30/01 20 how to connect mssql server using php UnlockedQ
XML
# Date Pts Title Type
7 08/01/01 80 How to use web service  UnlockedQ


0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6697150
If this proposed answer has helped you, please accept it, grade it and close this question.  If it did not, reject it and add comments as to your progress and what else is needed.  If no action is taken here by next week, we'll need to decide this outcome.  Expert input always welcome as well.

Thanks,
Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6954651
Finalized today be EE Moderator.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to open Waze.com/livemap from address saved in DB? 26 192
Write data from SQL to CSV file - position 1 61
MS Date Picker 64 bit 32 bit issue 12 55
Child Form in front 4 47
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question