Resizing listview column at run time


Author
Message
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I have a column in a listview ( not a Stratalistview )  that may not be relevant depending on how I pull the data.  If not, I would like to set its width to 0.

I thought I could say

this.lvCompare.Columns["colMyCol"].Width = 0;

but it tells me it is not set to an instance of an object.  I tried it after the requery but no luck

In debugger I see no properties exposed at all on the columns collection. 

What's the trick.?   Anyone have an example of how to do this? 

( remember, traditional SF listview,not Stratalistview )

TIA
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Try using its index position:

this.lvCompare.Columns[1].Width = 0;

Or I guess you could also iterate through all columns and find the one with the Header you are looking for, and then change its width.
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Obrigado, Ivan.  I'll try that.  Saw an overload for the columnheader and thought i could get away with that. 

If index works that will be fine.
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
De nada. Wink
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)Advanced StrataFrame User (924 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Using index worked great ! 
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Glad to hear that! Cool
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search