Question

change a single ListItem height

Asked by: menorcanet

How can I change a single ListItem's height in a ListView?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-14 at 04:51:20ID24652605
Topic

Delphi Programming

Participating Experts
3
Points
100
Comments
33

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Accessing ListItems in a ListView
    Hi, I'm trying to access individual ListItems in a ListView using the following code: 1. Dim itmListItem as ListItem 2. For intCounter1 = intCountParticulars To lvwParticularsList.ListItems.Count 3. itmListItem1 = lvwParticularsList.ListItems(intCounter1 + 1) ...
  2. ListView Control Row Height
    I am trying to find to change the height for the listitems (rows) in a ListView. I cannot seem to find any API reference to do this. Thanks.
  3. DragDrop listitem->listitem
    Hi! I want to be able to drag-dop one listitem from one listview to another. How can i determine on witch listitem i dropped? I now how to drag-drop the item listview->listview but how can i use the X and Y coordinates to determine if/on what item i dropped. regards, Dr...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: Geert_GruwezPosted on 2009-08-14 at 05:42:51ID: 25097357

i'm still trying to find a solution,
but at first sight ... it's not possible
is this in report style ?

1 possibilty would be set them all bigger and set the fontsize for 1 specific line higher

 

by: Geert_GruwezPosted on 2009-08-14 at 05:43:14ID: 25097359

or use a different component like
TMSGrid or DevExpress grid

 

by: menorcanetPosted on 2009-08-14 at 07:00:24ID: 25098085

Yeah report style. I'd rather not use other components if it's not possible (added complications.. I do a lot of custom subitem drawing)

 

by: dougaugPosted on 2009-08-14 at 07:53:50ID: 25098658

You should change the listbox style property to lbOwnerDrawVariable and write the code below to its MeasureItem event:

procedure TForm1.ListBox1MeasureItem(Control: TWinControl; Index: Integer;
  var Height: Integer);
begin
  if Index = 0 then
    Height := 30;
end;

 

by: menorcanetPosted on 2009-08-14 at 08:17:47ID: 25098942

I want to change the height in a ListView, not a ListBox.

 

by: dougaugPosted on 2009-08-14 at 08:45:25ID: 25099311

Oh, sorry, I didn't pay attention in the title.

 

by: EddieShipmanPosted on 2009-08-14 at 11:05:09ID: 25100667

This cannot be done as the Listview calls WM_MEASUREITEM once only and all items use the same MEASUREITEMSTRUCT.

 

by: EddieShipmanPosted on 2009-08-14 at 11:06:34ID: 25100683

Personally, I'd use a grid, because it is the control that you really *should* be using for this functionality.
You can continue to do your "subitem" drawing, it will just be in columns .vs subitems.

 

by: Geert_GruwezPosted on 2009-08-16 at 23:11:56ID: 25111919

imho, not possible

and for custom drawing ... mostly requires a lot of time and fine tuning
imho, this is time better spent learning on a advanced component
(it does take time to learn how to work with other components)
and the bonusses you get with the extra component far outweigh the extra's you get with custom drawing

there is off course allways the issue for @home or @work
@home ... free components usually get the upperhand
(difficult to explain to the wife why you want the new grid component)
@work ... just put the features and the time needed for both in a excel, with the hourly rate
(custom drawing will allways be more expensive ...)
and your manager should be easily convinced.

devexpress has all you need for this
with 1 event : OnGetCellHeight (for certains views, each cell can be individually set)
probably TMSGrid too (don't have that)

maybe some other free grids have this too.
like rowgrid in here : http://www.torry.net/pages.php?id=115


 

by: menorcanetPosted on 2009-08-24 at 05:58:31ID: 25167816

I've been testing with the grid components, but don't really like them at all. Guess I'll let it go. Was checking VirtualTreeView also but it's too much work to reproduce what I'm doing with ListView

 

by: EddieShipmanPosted on 2009-08-24 at 06:21:07ID: 25167985

If you just need help in making a grid control *look* like a TListview, that's definitely doable.

 

by: menorcanetPosted on 2009-08-24 at 06:55:33ID: 25168311

This is my current listview

http://i31.tinypic.com/28iz4oy.jpg

 

by: Geert_GruwezPosted on 2009-08-24 at 07:09:08ID: 25168427

takes about 1-3 days to set that up with devexpress
(depending on the knowledge and experience and number of listviews)

i modified an app from 80 listviews to all devexpress grids in 20 days
i still sweat just thinking about that

but the extra's you get are well worth time/money spent

some of them found the filtering and totalisation options
nothing i programmed in, just added a cxpopupmenu to the active grid
they were overjoyed with this, and starting using it extensively
then they wanted those grids in all the apps (200+),  that gave us a headache  ...

i believe tms has the same features

i'm not trying to advertise, just saying you may get more than you thought if you do it.

i still think what you are trying with listview is impossible  :<

 

by: menorcanetPosted on 2009-08-24 at 07:18:05ID: 25168521

Thing is.. it's a freeware application, not work related, so I don't wish to spend on components. What about virtualtreeview? I checked it briefly but seemed to complex/big to learn how to do everything with it.

 

by: menorcanetPosted on 2009-08-24 at 07:19:03ID: 25168527

The idea of wanting items with a different height is to "embed" a panel on top of what would be a blank area in the item, with some other controls; it would re-locate there upon selecting an item and scrolling.

 

by: Geert_GruwezPosted on 2009-08-24 at 07:23:02ID: 25168561

it is indeed very complex to start with
you really need to dig in this component to get to know it

I stepped back from it 2 years back when they bought devex quantumtree here

looks like you can do it with downloading the VirtualTreeView and
the extra EditLink components:
http://www.soft-gems.net/supplement/download.php?ID=48

There is a lot more documentation now on the site

The key part is understand the way it loads to paint.
It is very fast in drawing as it only gets the data it needs to show on screen.
and off course understanding the record per node structure
i used 1 variable in the record as a object
later on changing the object type is all you need to do add more data to the treeview

 

by: Geert_GruwezPosted on 2009-08-24 at 07:25:24ID: 25168581

hmmm
one idea would be to have an info area below/above your treeview with extra info for the selected record

if no info then set the panel visibility to false

we did this before we changed
now we use banded tables with a preview area per record

 

by: Geert_GruwezPosted on 2009-08-24 at 07:26:03ID: 25168592

i meant listview instead of treeview

below/above your *listview* with extra info for the selected record

 

by: menorcanetPosted on 2009-08-24 at 07:41:01ID: 25168762

I'm alredy doing that, but would rather the controls to be embedded in the list.

 

by: EddieShipmanPosted on 2009-08-24 at 08:43:21ID: 25169461

This could be done with a TStringList very easily. Can you post some of your data in CSV format?

 

by: EddieShipmanPosted on 2009-08-24 at 08:43:38ID: 25169466

I meant TStringGrid, not TStringList.

 

by: EddieShipmanPosted on 2009-08-24 at 08:44:34ID: 25169472

Can you also explain the "progress bars" and the different colors in them?

 

by: menorcanetPosted on 2009-08-24 at 11:54:05ID: 25171224

I'd have to explain in detail how the app works, there's no need. I just change the row or item color on the ondraw events and draw directly to the LV canvas to draw the bars.

Thinking of adding/removing a few blank rows at run-time when I select an item, just after the one selected and scroll up enough to place the panel with controls there, but it's a kinda dirty solution.

 

by: Geert_GruwezPosted on 2009-09-16 at 00:07:20ID: 25342709

i don't understand why you delete this Q

in your remark as to why to delete,
you state it can't be accomplished what you want

i posted just that in my first remark:
http://#25097357

according to ee rules you should accept that comment

 

by: Geert_GruwezPosted on 2009-09-16 at 00:27:42ID: 25342821

also stated in http://25100667

so should accept both those comments instead of deleting

 

by: EddieShipmanPosted on 2009-09-16 at 13:25:59ID: 25349761

When you say, 'opted for another way', please explain the other way? How do we know you didn't use one of our suggestions?

 

by: menorcanetPosted on 2009-09-16 at 17:20:30ID: 25351685

Hi, changing the font of the item I want bigger doesn't give me what I want (larger height of an item without changing the appearance, with the rest of the item below the text in blank).

http://i28.tinypic.com/hs6rg3.jpg

I opted to continue using a panel outside the listview like I was using before, as commented in 25168762

 

by: EddieShipmanPosted on 2009-09-16 at 18:52:04ID: 25352207

Well, we are at a loss to why you didn't modify your application to use a grid as we suggested, I began working on it using a plain stringgrid but you wouldn't give me enough information so I actually blame you for not being able to come up with a workable solution. It is NOT as difficult as you think to do this using a grid.

When you post questions here, you expect to get a solution but that also means that *we* expect you to provide us with info on what it is you really want and to also provide us with data, if required and to answer other questions.

While Geert_Gruwez has objected to your asking that the question be deleted, I won't. I just hope you have learned a lesson in using E-E because if you ask another question, expect the same from us. And if you don't provide us with what we ask, you, again, won't get a solution.

Remember, we do this for free, if you want it all coded for you, contact a contract programmer via rent-a-coder or elance.

 

by: menorcanetPosted on 2009-09-16 at 19:05:17ID: 25352264

Hi, I'm ok with accepting your contributions as answer (is multiple accept gone?, can only see "Accept as solution" atm), although my intent is still the same, do what I asked with a ListView, I don't wanna use a grid as stated before for various reasons. I considered further discussing pointless if, from the comments, it really is not possible to do with the ListView, and since there was no code or any major contribution I considered it was acceptable to delete the question given the current outcome. If you consider it wrong, I am sorry, I will still accept and award the points normally as I said. I have been in E-E for 10 years, I'm not new here.

 

by: Geert_GruwezPosted on 2009-09-16 at 23:54:16ID: 25353379

i objected to the question because it actually shows that it can't be done.
When other people ask the same question they may stumble upon this question
or this question can be used as a reference to shortcut a lengthy discussion

This question is just some proof that the way of achieving what you want can't be done.

I understand why you want it with a Listview.
You must have tons of experience with this (MSWindows) component.
And it would indeed be wrong to just drop all that experience and
do this with some other component.
Some components have limits, you ran into a limit of the listview
Maybe MS will alter it's component to allow this in the future.

As EddieShipman suggests it is easier to achieve with a grid component.
And it may be the only way of accomplishing your goal.

 

by: Geert_GruwezPosted on 2009-09-17 at 04:46:41ID: 25354930

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...