Menu

#25 issue with CellEditUseWholeCell on TreeListView

v2.X
pending
None
1
2020-12-27
2020-11-27
sanders
No

Hello,
As I can see there is an issue with cells editing on the TreeListView. I have enabled the properties CellEditUseWholeCell for Columns and for whole control.
The result:
error pic 1
error pic 2

But the first column has whole cell editor:
first column pic

Is this a bug?

Regards,
Alex.

3 Attachments

Discussion

  • sanders

    sanders - 2020-11-27

    error pic 1

    error pic 2

     
  • sanders

    sanders - 2020-11-27

    These are two files I modified in standard Demo (from ObjectListViewFull-2.9.1.zip) for you can reproduce the issue on your side.

     
  • Phillip Piper

    Phillip Piper - 2020-11-28

    If I copy those two files into my demo project and run it, the editing rectangle always covers the whole cell, as I would expect. Screenshots attached.

    Do you have any other code changes that might be influencing the controls behaviour?

     

    Last edit: Phillip Piper 2020-11-28
    • sanders

      sanders - 2020-11-29

      No, I haven't. For check this I download the ObjectListViewFull-2.9.1.zip again and compare all files. The only files differ from original I sent you previously.
      My environment: Win7, Visual Studio 2017, ObjectListView was installed by NuGet as ObjectListView.Official (v2.9.1)

       
  • Phillip Piper

    Phillip Piper - 2020-11-28
    • status: open --> pending
    • assigned_to: Phillip Piper
     
  • sanders

    sanders - 2020-12-04

    Hi Phillip,
    Any updates for me?

    Regards,
    Alex.

     
  • Troy Elder

    Troy Elder - 2020-12-20

    I've been bugged by this for a while, and seeing I'm not the only one I found a solution:

        private void olv_CellEditStarting(object sender, CellEditEventArgs e)
        {
            if (e.SubItemIndex > 0)
            {
                int indent = 15;
                int padding = 5;
                int treeDepth = Find Depth of Object;
    
                int offset = (++treeDepth * indent) + padding;
                e.Control.Left -= offset;
            }
        }
    
     
    • sanders

      sanders - 2020-12-27

      I had to do this way:

              private void treeListView_CellEditStarting(object sender, CellEditEventArgs e)
              {
                      .....
                      e.Control.SetBounds(e.CellBounds.X, e.CellBounds.Y, e.CellBounds.Width, e.CellBounds.Height - 2);
                      ......
              }
      
       
  • Troy Elder

    Troy Elder - 2020-12-27

    If you are using CellEditUseWholeCell = true; you should also add
    e.Control.Width += offset;

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.