Solved

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

Posted on 2001-09-17
9
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

751 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