?
Solved

Adding a row to the listview....

Posted on 2005-03-22
4
Medium Priority
?
578 Views
Last Modified: 2008-03-03
i have a listview with 2 columns.. i need to add a row in that list view....
how can i do that... now i am able to add a row with only a single colum...
the code looks like this....


    lvitem.mask      =   LVIF_STATE | LVIF_TEXT | LVIF_PARAM;
    lvitem.state     =   0;
    lvitem.stateMask =   0;  

    lvitem.iItem     = 0;
    lvitem.iSubItem  = 0;
    lvitem.pszText   = lvi.pszText;

    lvitem.pszText   = "hai";

    lvitem.lParam        =      (LPARAM)23;

     ListView_InsertItem(<Handle to the list view> ,&lvitem);
0
Comment
Question by:r_a_j_e_s_h
[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
  • 2
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 2000 total points
ID: 13601619
Use ListView_SetItem Macro. Set LVITEM::iItem to item number in the list, LVITEM::iSubItem to column number (1), LVITEM::pszText to subitem text.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 13601641
LVITEM::iItem should be equal to value returned by ListView_InsertItem.
0
 
LVL 3

Author Comment

by:r_a_j_e_s_h
ID: 13601651
i solved it.,.. this is the code....


lvitem.mask      =   LVIF_STATE | LVIF_TEXT | LVIF_PARAM;
    lvitem.state     =   0;
    lvitem.stateMask =   0;  

    lvitem.iItem     = 0;
    lvitem.iSubItem  = 1;
    lvitem.pszText   = lvi.pszText;

    lvitem.pszText   = "hai";

    lvitem.lParam       =     (LPARAM)23;

     ListView_InsertItem(<Handle to the list view> ,&lvitem);
0
 
LVL 3

Author Comment

by:r_a_j_e_s_h
ID: 13601666
ListView_setItemtext() will do
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Suggested Courses

777 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