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 » Select row in grid when Collapse All
Subject Author Date
Offer Har Dec 8, 2008 - 10:37 AM

Dear Support,


I have a grid when each row have a number cell header on the left side.


I want that the row, or the first editable cell in the row will be selected when the number cell is pressed. Cuurently when I hover over the number cell, the cursor changes to a left pointing arrow, and clicks are ignored.


This is how I initialize this cell:



    CExtGridCellHeader* pCellHeader = (CExtGridCellHeader*)GridCellGetOuterAtLeft(0, nRowCountIndex, RUNTIME_CLASS(CExtGridCellHeader));
    
    if (NULL==pCellHeader)
    {
        return -1;
    }

    pCellHeader->ModifyStyle(
        __EGCS_HDR_FOCUS_ARROW_RESERVE_SPACE|
        __EGCS_HDR_FOCUS_ARROW_DISPLAY|
        __EGCS_HDR_ROW_COLUMN_NUMBER|
        __EGCS_TA_HORZ_RIGHT);

Thanks,


Ron.

Technical Support Dec 9, 2008 - 9:56 AM

A click on a header cell can be used for sorting rows/columns or selecting them. We thing you should simply apply the __EGBS_SF_SELECT_OUTER_ROWS style with the grid’s SiwModifyStyle() method.

Offer Har Dec 9, 2008 - 4:52 PM

I have this flag set, and still, when clicking the row header cell nothing happens. I sort my rows by clicking the column headers, I don’t need to sort columns, the row header is used to give each row a serial number to identify the rows, so I would like it that when the number is pressed, the first cell in the row will be selected.


 

Technical Support Dec 10, 2008 - 2:04 PM

Please compare how you initializes your grid window with how it is done in the Order Details grid in the SimpleGrids sample. The grid sorts rows when a header cell at top is clicked. It selects rows when a header cell on left is clicked. Unfortunately, it’s not possible to select
only grid cells in the first column when a header cell on left/right is clicked. You should override the CExtGridBaseWnd::OnGbwAnalyzeCellMouseClickEvent() virtual method to determine which header cell was clicked and select appropriate cell areas using the CExtGridBaseWnd::SelectionSet() method.