This project is read-only.

Event Double Click between two header

Nov 4, 2010 at 4:14 PM
Edited Nov 4, 2010 at 4:15 PM

Hello ,

I am using sourcegrid  as usual  , a good option appeared for  me under this greategull grid ,

the event doubleclick on the seperator between two header do a function of autosize for a best show  , i tried this function under excell , work well , under the explorer workwell :))

my question is how to reproduce this event by code  ? it can be better the the exist one  autosizecell ( better performance  and  better result )

i tested  this event under windows seven 64 bit but i think it work also under  xp and other version

I uploaded the demo if my explication is poor

.gif demo low  quality :

.avi demo hight quality :

i hope some one know the answer  , may be a hook from windows  , may be not .



Nov 4, 2010 at 6:22 PM

I thing i getted  , sorry for disturb


just to share the source from the code


at SourceGrid.Cells.Controllers.Resizable

On event OnDoubleClick


public override void OnDoubleClick(CellContext sender, EventArgs e)
base.OnDoubleClick(sender, e);

Point currentPoint = sender.Grid.PointToClient(System.Windows.Forms.Control.MousePosition);
Rectangle cellRect = sender.Grid.PositionToRectangle(sender.Position);

float distance;
DevAge.Drawing.RectanglePartType partType = LogicalBorder.GetPointPartType(cellRect, currentPoint, out distance);

if ((ResizeMode & CellResizeMode.Width) == CellResizeMode.Width &&
partType == DevAge.Drawing.RectanglePartType.RightBorder)
else if ((ResizeMode & CellResizeMode.Height) == CellResizeMode.Height &&
partType == DevAge.Drawing.RectanglePartType.BottomBorder)