Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtGridWnd columns getting shifted off to the left out of view (with no horizontal scrollbar) Collapse All
Subject Author Date
Krustys Donuts Jul 8, 2008 - 1:01 PM

I’m using Prof-UIS version 2.83.  I have a CExtGridWnd with 5 columns.  The 5th (rightmost) column is editable.  The columns are all narrow enough to all fit in the horizontal space available to them, so the horizontal scrollbar at the bottom of the control is grayed out.


When the user clicks in the rightmost column, the columns all immediately shift two columns to the left, so that the 1st and 2nd columns are clipped off.  However, the horizontal scrollbar is still grayed out, so the user cannot scroll the columns back into view!  The only thing the user can do is use the left-arrow key to move keyboard focus back into the leftmost column, which causes it to horizontally-scroll back into view.


What should I do to prevent this ridiculous auto-scrolling?


 


The CExtGridWnd’s style flags are set by the code below, if this helps:


 




 DWORD extGridBaseStyle = __EGBS_SFB_CELLS | __EGBS_GRIDLINES_H | __EGBS_GRIDLINES_V |

       __EGBS_NO_HIDE_SELECTION | __EGBS_RESIZING_CELLS_OUTER_H | __EGBS_DYNAMIC_RESIZING_H |

       __ESIS_DISABLE_AUTOHIDE_SB_H | __ESIS_DISABLE_AUTOHIDE_SB_V | __EGBS_SUBTRACT_SEL_AREAS;

 SiwModifyStyle( extGridBaseStyle, 0, false);

 DWORD extGridBaseStyleEx =  __EGBS_EX_CELL_TOOLTIPS | __EGBS_EX_HVI_EVENT_CELLS | __EGBS_EX_HVO_EVENT_CELLS |

        __EGBS_EX_HVI_HIGHLIGHT_ROWS;

 SiwModifyStyleEx( extGridBaseStyleEx, 0, false);

 DWORD extGridWndStyle = __EGWS_BSE_EDIT_CELLS_INNER | __EGWS_BSE_EDIT_SINGLE_LCLICK | __EGWS_BSE_EDIT_DOUBLE_LCLICK |

       __EGWS_BSE_EDIT_SINGLE_FOCUSED_ONLY |

       __EGWS_BSE_EDIT_RETURN_CLICK | __EGWS_BSE_WALK_HORZ | __EGWS_BSE_WALK_VERT; // | __EGWS_BSE_EDIT_AUTO

 BseModifyStyle( extGridWndStyle, 0, false);

Krustys Donuts Jul 10, 2008 - 2:38 PM

I couldn’t get the problem to reproduce in the test application you attached, no matter how I massaged it (reduced the number of columns, changed the style flags to match mine, etc.).


However, I discovered that removing the __ESIS_DISABLE_AUTOHIDE_SB_H style flag from my own grid (in the call to SiwModifyStyle() ) makes my problem go away.

Technical Support Jul 9, 2008 - 12:40 PM

First of all, please invoke the OnSwUpdateScrollBars() method at the end of grid initialization. The scroll bar states should be always synchronized with the width/height of columns. If you do not need the horizontal scroll bar, you should disable or hide it. If the OnSwUpdateScrollBars() method does not help, we would like to ask you to reproduce the problem using the following very simple grid-based test application and send it to us:


Krustys Donuts Jul 10, 2008 - 2:39 PM

I couldn’t get the problem to reproduce in the test application you attached, no matter how I massaged it (reduced the number of columns, changed the style flags to match mine, etc.).


However, I discovered that removing the __ESIS_DISABLE_AUTOHIDE_SB_H style flag from my own grid (in the call to SiwModifyStyle() ) makes my problem go away.

Technical Support Jul 10, 2008 - 3:25 PM

If you are using the __ESIS_DISABLE_AUTOHIDE_SB_H grid style, please ensure the grid window is created with the WS_HSCROLL standard window style which makes the horizontal scroll bar initially visible. If the grid window is created without the WS_HSCROLL style, then you can apply it using the following code:

CExtGridWnd & wndGrid = . . . 
    wndGrid.ModifyStyle( 0, WS_HSCROLL, SWP_FRAMECHANGED );
After that you can apply the __ESIS_DISABLE_AUTOHIDE_SB_H grid style and it should work without any problems.