Override for "double click" resizing

Posted by: mikedempsey on 8 September 2017, 3:20 pm EST

  • Posted 8 September 2017, 3:20 pm EST

    I saw a post from a couple of years back saying that OnDoubleclick() or OnCellDoubleclick() were not raised when a user double clicks the right edge of a header cell to resize the column.

    The response was that this would be reported as a bug.

    I am trying to override that action myself in Spread 9 ... but it still doesn't fire.

    Is this going to be addressed? Or has it already been addressed in some other way?

    There are really 2 issues:
    The first is that it does not allow me to resize a column wider than the visible grid width.
    (I initially set the width to slightly less that the available width and if I double click the header edge it only increases it a few pixels - to the available display width - instead of making it about 4x wider.)
    The second is that it does not raise any OnDoubleclick method.

    I need to be able to handle resizing of 'wide' columns.
    That is columns that are wider than the current width of the grid.
    Users want to be able to scroll through the contents of a wide cell, But currently the cell is never set wider than the grid so I want to use that double click to set it to the full required width ... then restore it to the grid width if they do it again. (A cell might be many grid widths wide so they don't generally want to leave the column that wide, and dragging it narrower would take many separate drag operations.)

    Thanks
  • Replied 8 September 2017, 3:20 pm EST

    Hello,

    Please go through these forum and documentation links for the same:-
    http://sphelp.grapecity.com/forums/topic/avoid-resize-on-column-click/
    http://sphelp.grapecity.com/WebHelp/SpreadNet8
    /WF/webframe.html#FarPoint.Win.Spread~FarPoint.Win.Spread.Column~Resizable.html
    http://sphelp.grapecity.com/WebHelp/SpreadNet8/WF/webframe.html#FarPoint.Win.Spread~FarPoint.Win.Spread.Row~Resizable.html

    Hope it helps.

    Thanks,
    Reeva
  • Replied 8 September 2017, 3:20 pm EST

    Yes I had already seen those posts and in fact I'm using an override of the WndProc() method to perform my own sizing ... but that is really NOT something we should need to override.
    An 'On' method would be a much better [more standard] way to go.

    I can understand that GetPreferedWidth() will not return a width greater than the visible area width since that allows you to add some performance shortcuts.
    Measuring hundreds of thousands of 'wide' cell values would take forever - so stopping as soon as you find one that is too wide for the display is a great shortcut.
    (That is one of the shortcuts I use myself when sizing all columns - I cant just use your function on each column or it could take hours [literally] just to set the widths for some database results.)

    So does that mean the comments I saw a year or 2 back (that you were planning to fire OnDoubleClick, or OnCellDoubleClick, when a user performs a doubleclick resize) are not correct?
  • Replied 8 September 2017, 3:20 pm EST

    Hello,

    You can use ColumnwidhtChanging and ColumnwidthChanged event for the same which occurs when the column with is changing and column with has changed respectively:-

    http://sphelp.grapecity.com/WebHelp/SpreadNet9
    /WF/webframe.html#FarPoint.Win.Spread~FarPoint.Win.Spread.FpSpread~ColumnWidthChanging_EV.html
    http://sphelp.grapecity.com/WebHelp/SpreadNet9/WF/webframe.html#FarPoint.Win.Spread~FarPoint.Win.Spread.FpSpread~ColumnWidthChanged_EV.html

    Hope it helps.

    Thanks,
    Reeva
  • Replied 8 September 2017, 3:20 pm EST

    Those events don't tell me whether the width is changing due to a double click so they are of no use in handling a 'double click' width change.
    If the user is dragging the column border to a specific width I do not want to override their action.
  • Marked as Answer

    Replied 8 September 2017, 3:20 pm EST

    Hi,

    I agree, DoubleClick and CellDoubleClick should fire before ColumnWidthChanging when the user does auto-fit action by double-clicking the gutter area between column headers. I have submitted this as a bug (#140038) for repair in the next maintenance release of v9. I am not sure why it was not fixed when it was reported before (it should have been).

    Regards,
    -Sean
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels