Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Is There A Way To Hide Listview Columns?


hey guys I have a listview called report. Is there a way to hide the first column, so thats its there and the program can access it, but just hidden from the user?

Thanks!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Allow User To Hide/show Columns In Listview???
Hi,
is there a way to allow users to choose to hide and show columns in a listview? thanks, beth

Resizing Columns In One Listview To Automatically Resize Corresponding Columns In Another.
I'm currently building the front end to a VB6 application. This app is largely based on entering data into a Listview. In order facilitate data entry, I need to create an editable row beneath the listview, comprising of text boxes(unless there is a better method) and an "add" button. The problem is that when a column in the Listview is moved or resized, the array of textboxes need to reflect this change of order/size, as each textbox needs to appear beneath its corresponding column. Also, if the listview contains a large number of columns, and therefore a horizontal scrollbar, the textboxes will need to scroll also... I would be very grateful for any help..! Thanks...

Hide Rows Or Columns
An interesting code, for us working with complex spreadsheet, would be to know how to create a macro that would remove an entire row containing ZEROS in the cells. In example below, only the Account#70200 row should be hidden (NOT the 70400).

Example:

Account# January Feb March
70100 1,000 2,100 3,000
70200 0 0 0
70300 1,200 1,100 2,000
70400 0 2,100 2,100

Similar trick for hiding columns with zero or no values would be very usefull.

Hide All Unused Columns
Servus again,

I want to integrate a macro, that hides all unused (=empty) columns. But: the empty column, that follows directly to a not-empty column, is supposed to be unhided.
E.g.: A is empty --> hide. B is filled --> unhide, C is empty --> unhide because it follows directly to B ...

The code does not seem to work, but i don't know why... Any idea??

Here is the code:

Sub LeerKiller()
Dim row, col, dist, cont As Long
dist = 0
cont = 0

For col = 1 To 300
For row = 1 To 65000
If Not Cells(row, col) = "" Then
Columns(col).EntireColumn.Hidden = False
cont = cont + 1
Exit For
End If
Next row
If cont = 0 Then
Columns(col + 1).EntireColumn.Hidden = True
End If
Next col
End Sub

MSHFlexGrid Hide Columns
I am filling a mshflexgrid with a recordset of 4 fields. I only need to show
two of the fields in my flexgrid, and the other two fields I only need for calculation. How can I handle this ?
The grid have 4 columns; column 1 and 2 should be from the recordset, and
column 3 and 4 is additional fields. Hope someone can give me some good ideas.

How To Hide MSFlexGrid Columns
I use flex.ColWidth(5) = 0 to hide the column five but I really want to hide a column allowing the user to resize only the columns wich are not hidden. If you position the mouse between 2 colums and there is a hidden colunm between them you can resize it and becomes visible which is not what I want. Any idea will be appreciated.

Hide Columns In DataGrid
Dear friends,

I have 5 fields in Table Items.I created DataGrid to view the table.
I have 5 cols. as follows.

code,name,uom,desc and stock.

But I don't want to display all the columns.I want to display only
code,name and stock.How to hide other cols, Please help me to do!

DBGrid Hide Columns........
I have a DBGrid with Columns that I require, however I change the RecordSource to the DBGrid on several occasions this is to save hiding three diferent DBGrids.

As you can Imagine there are unused columns showing in the dbgrid which means you have to scrole to see parts of the data.

Is there a way to hide columns on run time?


thx

Hide Columns In Datagrid
Hi! i use a recordset to set datagrid datasource.
as below,



rs.open "select ID,name,Desc from table" 'rs recordset
set dg1.datasource=rs 'datagrid dg1



My problem is how to hide 'ID' field from the datagrid.
I dont want to display that column.

I know there's a property named 'visibleCols' in datagrid.
it gives the number of columns displayed. How can i put it
to use to hide a column. Any other alternative too will be
great!.

thnx
Mur.

Hide The Columns And Rows
Hai gurus
Can I hide some(not all not thru width =0) columns or some rows in the list view?
regards
Rajender G

Hide/Unhide Columns With One Button
Hi,

I have recently written a macro that hides and unhides a specified number of columns, but would like to build an If statement to consolidate the macro into one procedure. Here's what I'm trying to do...

I have data in columns ("A:F") and would like to be able to hide and unhide columns ("B") with the same button. So, if I click the button once, it will hide columns B,C,D. If I click the same button again, it will unhide columns B,C,D. On the third click it will once again hide the three columns.

Any help would be greatly appreciate. Thanks!

Select Sheets And Hide Columns
Hi,

I got a workbook with 46 sheets. I need to select (range) sheet 12 to 46 and hide some columns.

This is what I tried, but I wasn't really lucky with that:

Sub HideRows()

Sheets(Array("12":"46")).Select

Columns("K", "W", "AA", "AC", "AD", "AE", "AH", "AS", "AL").EntireColumn.Hidden = True

End Sub

What am I doing wrong?

Thanks in advance

How To Hide Columns And Rows Not Needed?
Hi, i would like to hide the columns and rows that i dont need when the workbook is open.

I was thinking a For loop from B3 - the last column, but how do i find out the last column?

Same goes for the row.

Also what is the command to add a row or column.
Thanks a bunch..

Resolved-How To Hide Columns With MSflexgird
Hello.

I have no problem with setting the visibility of columns for databoundgrid but I have not yet figured how to hide columns in msflex grid. And also can you use wrap text function with msflex gird. Hm. I use msflexgrid because I want each row to have a specific color determined value of a field in the row. That is not possible with databoundgrid at least in VB6. And with msfelx gird I would like to hide some colums and use wrap text function. Any ideas would be apprichiated and if someone has any ideas on costum controls that would be great. I am looking for something that has both functions of msflexgrid and databoundgrid. A freeware control somewhere?

Hide Columns In Excel Sheet
Hi,
 guys, i need help in hiding columns in excel sheet using userform on load. And but when i read data from the excel sheet, it should read from all the columns in excel sheet including from those hidden columns.

If any of you come across, please help me.

Thanks,
 Chandra

How Do I Hide/unhide Columns In A List View?
I want the user to choose the columns for a specified output though all the columns will be filled

with data , i want to display only those columns which the user selects.Currently i make the width

of the hidden column as - 0 but that the user can just keep his mouse on the header and drag to

see the hidden column. How do I actually hide it???

How Do I Hide Columns In MSFlexGrid. I Am Using FlexGrid Control 6.0
can i know how to do it

 

Edited by - karenstar on 6/14/2004 10:40:46 AM

Adding Columns To A Listview That Already Has Columns
Hi

I'm new to VB6 (I usually program in VB.NET but have been asked to make an enhancement to a VB6 application).

I have a listview which has columns defined within it in the designer. The code I am looking at then retrieves data from a db and puts it into the listview.

I've been asked to add another column in the middle of the listview e.g. there are 10 columns defined in the designer and this new column needs to go at position 6. However, the data that needs to go in the new column needs to come from a different query than the one that fills the other columns. I therefore thought that the best way to do it was fill up the original columns and then slot in the new column and fill it from another query. I've been searching around but can't find any example of how to do this.

Please can anyone help, or suggest a better way to do it? Thanks!

2 Qs : Timer And How Do I Hide/unhide Columns In A List View?
hi,
2 questions
For a listview, I want the user to choose the columns for a specified output though all the columns will be filled with data , i want to display only those columns which the user selects(Like we have it in windows explorer). Currently I make the width of the hidden column as - 0 but that the user can just keep his mouse on the header and drag to see the hidden column. How do I actually hide it???

Second question:

I have just recently find out that one cannot set the interval time of a timer for than 65000 millisecs that is apporx a minute. How do I set the interval of a timer for more than a minute say 3 minutes?

Thanks.

Programmatically Can't Hide Columns On A MSHFlexGrid With BandDisplay Set To Vertical
I am having trouble programmatically hiding columns on a vertical MSHFlexGrid.

I am able to hide columns on a vertical MSHFlexGrid at design time, but not at run time.

Because I am using Vertical BandDisplay I am not able to use the Column Width of zero.

Looking for answers!

BobbyT

Is There A Way To Hide A Row In A Listview
I need a way to hide a row in a listview control. Is there anyway to do this?

Listview How To Hide A Row
Is there a way to hide a row in a listview?  As the listview is being populated with rows of data some of them I want to keep hidden from the end user but still in the listview to use later in the program.  I could store that data in an array but  now I am more curious of how to hide a row in a listview

Listview Hide Column
Is there a way to hide a specific column in a ListView control beside setting its width to zero? If not, is there a way to prevent a user from changing its width during runtime?

Hide ListItem In ListView
Hi!

My problem is: hiding the listItem in a ListView.

unfortunately the properties: (ListItem.Height) and (ListItem.Hide) are missing!

I searched for this problem, but without good results!

Someone know some method (API, subclassing, etc...) resolutive??

Hide Column's And Row's Listview
Does anyone know hoe to hide a colum, and how to hide rows in a listview ? (not setting width or height to 0, but actually hiding)

Hide Items In Listview
Hello...

I have attached some pic ....

I fill the listview like this:


Code:
'SQL...QUERY

Do Until Tabela.EOF

If Not IsNull(!Voznik_sif) Then
lstPlanIzpis.ListItems.Add.Text = !Voznik_sif
End If
If Not IsNull(!PriimekIme) Then
lstPlanIzpis.ListItems(x + 1).SubItems(1) = !PriimekIme
End If
If Not IsNull(!UlicaSt) Then
lstPlanIzpis.ListItems(x + 1).SubItems(2) = !UlicaSt
End If
If Not IsNull(!Kraj) Then
lstPlanIzpis.ListItems(x + 1).SubItems(3) = !Kraj
End If
If Not IsNull(!Telefon) Then
lstPlanIzpis.ListItems(x + 1).SubItems(4) = !Telefon
End If
If Not IsNull(!Ura) Then
lstPlanIzpis.ListItems(x + 1).SubItems(5) = !Ura
End If
If Not IsNull(!Namen_sif) Then
lstPlanIzpis.ListItems(x + 1).SubItems(6) = !Namen_sif
End If
If Not IsNull(!Nacin_sif) Then
lstPlanIzpis.ListItems(x + 1).SubItems(7) = !Nacin_sif
End If
If Not IsNull(!Opombe) Then
lstPlanIzpis.ListItems(x + 1).SubItems(8) = !Opombe
End If
If Not IsNull(!KoncnoStanje) Then
lstPlanIzpis.ListItems(x + 1).SubItems(9) = !KoncnoStanje
End If
x = x + 1
.MoveNext
Loop
End With

Now I want to hide duplicate names in listview (see att. photo).
Any idea?

How Can I Hide A Column In A Listview
hi all,

how can i add a column of a listview where am displaying the keyfield (autonumber field) which i dont want to display to the client. but it should be there in the listview to be there as a keyfield.

thanx in advance
saj

Hide Column In Listview
How do you hide a column in Listview?

Also, if it is Hidden can the column still be populated with Data?

vbMarkO

Hide ListView Items
Hi,
Any one of you know if ListView rows(in report view) can be hidden using API. Through SendMessage or PostMessage API.

Any help would be appriciated.

Danial

Listview Hide Column
I want to hide one column in a listview object.
I tried to set the width of the column to 0, then I got the result I wanted. But if I resize the columns by scrolling the columnheaders, then the hidden column will be visible.
How can I really hide an Column in a ListviewObject?

Hide Column In Listview??
Can I hide columns in the listview.
If not are there any god ways to save invisible data to different data in a listview?

Hide A Listview Item?
Is it possible to hide a listitem in a listview? I need it to be in the ListItems collection of the ListView, but is should not be visible.

I would rather not have to maintain my own collection or array and show only these that need to shown. This would require me to change some fundamental things of the project, and I would like to keep that as my final option.

Any ideas are welcome

ListView Hide Column
Is there a way to hide a specific column in a ListView control beside setting its width to zero? If not, is there a way to prevent a user from changing its width during runtime?

Hide A Column In ListView
Hi,

If I have 3 columns in a ListView control and I want to display only the first two, what should I do?

Thanks, Lior

Hide One Column In Listview?
i need help. i want to hide one column in listview using CODE not using listview properties. thanx in advance. waiting to your reply.

Hide Part Of A Listview
Hi,
I have a listview with a number of columns. I would like to have a checkbox which hides/displays some (not all!) of those columns. While the columns are hidden, they would still be functioning - i.e. an inserted row would still update those columns and i could still read data in those columns. However, the columns just wouldn't be visible. how to do this?? thanks!
jon

Hide The Column In The Listview
Hai Gurus
How to hide a column in the listview ?
By using column.width =0 we can but the user can drag and see the column details which I dont want
Thanx in advance
Rajender G

ListView Columns
How do i add columns to a ListView and also how do i insert information into a listview box? For my listview i require 3 columns: 'Artist', 'Track' and 'CD'.

I have tried adding columns using the properties dialog, but they don't appear when i run the form.

Any help is much appreciated!

James

Listview Columns
if I do lvwListView.listitems.additem ,, "test"
it adds an item in the first column of the listview
how do i add data in the second column of a listview

ListView Columns
I have four columns in a list view, each taking up 25% of the available space. When the form resizes, I am successfully resizing the ListView, but how do I resize each of the columns back to 25% of the new size.

I have tried ListView1.ColumnHeaders.Items(0).Width, but that results in a Out of Bounds Error. I have also tried with Items(1) with the same result.

Any idaes

Listview Columns
thought i would have a go using a listview in report mode.

i must be missing something and see what.
when i insert a column and give it a caption it will insert it but then i have 2 columns.
i wanted 3 columns altogether but it shows 4, always 1 more.

what am i missing ?

thanks
thingimijig.

ListView Columns
If I have 2 columns in a ListView (set to Report), how can I add data to them? I have tried for ages, and I cant figure it out.

Columns To A ListView
Is it possible to add Columns to a ListView manually or does it have to be done at runtime?

Two Columns In Listview
sorry, this may be a silly question but its very frustrating,

all i need is for my listview to display two columns of data, taken from a query currently i can achieve one column but i need to add another with "LastName" cheers, here is my code so far


Code:
Set cn = New ADODB.Connection 'we've declared it as a ADODB connection lets set it.
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= c:vdmcertymate VBdatadata.mdb" 'this is the connection string explained in the notes section.
cn.Open
Set rs = New ADODB.Recordset 'as we did with the connection
rs.Open "qryEmployees", cn, adOpenKeyset, adLockPessimistic, adCmdTable 'opening the recordset explained in the notes

'Code to populate the listView
While Not rs.EOF
lstvEmployees.ListItems.Add , , rs.Fields("FirstName").Value
rs.MoveNext
Wend

rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing

Me.MousePointer = 0 'Resets Mouse Pointer


oh. and how do i get the listview to add a verticle scrollbar?

Listview Columns
this is a quick question really can u parse a site out into a listview with columns for different info from the site?
its a bit tricky to explain and show you as i want to connect to a site in inet grab the source parse out some hardware information,how many on the site, and how many on order and the price into one listview nicely 'ordered with column headers..
i can connect and parse the hardware info into the listview fine but i was wondering on how to do the other parts but because u need an account on the site i cant show u it however here is some of the info from the source (the parts ive gotten out and im needing to parse out..

HTML Code:
>10/100MBPs NIC</a></td><td align="right">4.96&nbsp;£</td><td align="right"><div class="g">4</div></td><td align="right"><div class="b">2<

theres say part of the info from the source ive gotten the 10/100 "part" fine but i need to get the "4.96, class="g">4< amount and class="b">2< amount (which change obviously...
is this possible to parse into a listview with columns to save me having to go to the site each time and then get those parts of the info which really defeats the purpose of the program? or do i need to use a different control other than listview?
any help or tips would be great

Listview With Different Columns?
In Listview I want to create 5 columns each having column header as "S.No", "From", "Subject", "Date", "Time"
I created Column headers in design time but they are not getting displayed? Also I want that S.No column to be having Checkboxes. How to do that? Thanks.

Listview Columns
I can only select the index column out of my data when in a listview. Code and input follows: Also I cannot input files other than the one I used to test with, of the same format?! (Not the one attached)


Option Explicit

Private Sub Form_Load()
Dim K As Integer
Dim itmX As ListItem
Dim clmX As ColumnHeader

K = 1

Set clmX = ListView1.ColumnHeaders.Add(, , "Column 1", ListView1.Width / 5)


ListView1.BorderStyle = ccFixedSingle
ListView1.View = lvwReport

ListView1.ListItems.Clear

Dim FF As Integer
Dim strLine As String
FF = FreeFile
Open "C:sheet.csv" For Input As #FF
Do While Not EOF(FF)
Line Input #FF, strLine
AddListView strLine
Loop
Close #FF


End Sub

Private Sub AddListView(S As String)
Dim Ar() As String
Dim i As Integer
Ar = Split(S, ",")
If UBound(Ar) > ListView1.ColumnHeaders.Count Then
For i = ListView1.ColumnHeaders.Count To UBound(Ar)
Dim clmX As ColumnHeader
Set clmX = ListView1.ColumnHeaders.Add(, , "Column " & i + 9, ListView1.Width / 5)
Next
End If
Dim lv As ListItem
Set lv = ListView1.ListItems.Add(, , Ar(0))
For i = 1 To UBound(Ar)
lv.ListSubItems.Add , , Ar(i)
Next
End Sub

Private Sub SortListView(ByRef List As ListView, ColHeadIndex As Integer)

Dim lcv As Long 'Loop Control Variable

With List
' Make sure the Sorted property is set to true
.Sorted = True

' Sort according to the colum that was clicked (off by one)
.SortKey = ColHeadIndex - 1

' Does the column already have an icon?
If .ColumnHeaders(ColHeadIndex).Icon = 0 Then
'No, So we will assume this column is not sorted

' Set to Ascending order
.SortOrder = lvwAscending


' Set the sort order to descending
.SortOrder = lvwDescending

Else
' Otherwise sort into ascending order

' Set to Ascending order
.SortOrder = lvwAscending

End If

' Refresh the display of the ListView Control
.Refresh
End With
End Sub

Listview Columns
when using a listview in report mode, do you always have to have a blank list at the end.

when i add columns through its properties there is always another blank one, and if i try and size it to fit the size i want it either still shows a bit of the blank one or i get rid of it and a scrollbar appears.

any ideas!
thanks.

thingimijig.

ListView Columns
Sups,
I got a listview with two columns on it.
I forgot how to add item to each column.
How can I do that?
tnx.

Copyright © 2005-08 www.BigResource.com, All rights reserved