Solved

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

Posted on 2001-09-17
9
216 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 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