CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890

    Question listview question ?

    hi,
    I am having difficulty in editing the innner data items inside the listview in column view (details)

    herez how I add item

    int i = listViewFeeDetails.Items.Count+1;
    ListViewItem lv = new System.Windows.Forms.ListViewItem(new string[] {
    i.ToString(),
    "FEE "+i.ToString(),
    "0.00"}, -1, System.Drawing.SystemColors.WindowText, System.Drawing.SystemColors.Window, new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))));
    listViewFeeDetails.Items.Add(lv);

    now by adding one item it adds
    "1", "Fee 1", "0.00"
    I have kept the labeledit to true but its not allowing inner labels like
    "Fee 1" and "0.00" to be editable ?

    how do I achieve that?

    -thanks in advance
    -Paresh

  2. #2
    Join Date
    Dec 2000
    Location
    Slovakia
    Posts
    1,043
    Yes, that is the required behaviour. When you set the LabelEdit property to true, listview control allows you to edit the item labels.

    Item labels are the first item in the row. (Sub item with the index 0).

    If you need to edit also subitems, you need to implement that behaviour yourself. Even, you can use some grid instead of listview control.

    Martin

  3. #3
    Join Date
    Aug 1999
    Location
    Romania, Bucharest
    Posts
    253
    try to place an editbox on top of your listview and than change the value of subitems
    if you need a sample i can provide one
    let me know if this help

  4. #4
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    sure this helped me. could u provide sample. thanks

  5. #5
    Join Date
    Aug 1999
    Location
    Romania, Bucharest
    Posts
    253
    take a look at this
    (I can't upload the entire solution archived but if you provide me an email adress...)
    Attached Files Attached Files

  6. #6
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    hey thanks buddy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured