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 » CExtTreeGridWnd with no row header Collapse All
Subject Author Date
Offer Har Mar 25, 2007 - 7:35 PM

Dear Support,

I would like the CExtTreeGridWnd to look exactly like a CTreeCtrl.
The difference is that a grid must have a column header - if I remove this line from my grid’s initialization:

OuterRowCountTopSet(1, false);

The gird crashes.

Is there any way around this? like hiding the header?

Thanks,
Ron

Technical Support Mar 26, 2007 - 11:31 AM

Yes, you can hide the header row by setting its height to zero (OuterRowHeightSet()).

Suhai Gyorgy Mar 26, 2007 - 1:53 AM

I’d try to use this function: virtual void OuterRowHeightSet( bool bTop, LONG nRowNo, INT nHeight); like this OuterRowHeightSet(true, 0, 0);

Offer Har Mar 26, 2007 - 11:24 AM

Yep.
Does the work - thanks.

Technical Support Mar 26, 2007 - 12:06 PM

We would also add some additional details. If the content of one or more tree items is so long that it does not fit the grid’s width, then there are two options available.

1. Tree grid with horizontal scroll bar.

Apply the BestFitColumn() method for each column. Please note that after a new row is added (CExtTreeGridWnd::ItemInsert()) or a row gets expanded/collapsed (CExtTreeGridWnd::ItemExpand()), you should call BestFitColumn() again in order to account for the changes made to the visible content. You can do this by overriding those two methods.

2. Tree grid without horizontal scroll bar.

Strecth the content out to the entire width by applying the __EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS style to the grid and setting a proportion for each column. The entire width will be divided proportionally between all columns according to the values (1.0 corresponds to 100%) you set for each header cell using CExtGridCell::ExtentPercentSet(). Please note long items will be truncated in this case. However, you can apply __EGBS_EX_CELL_EXPANDING_INNER to the grid so that you can see he content of a truncated item in a pop window that appears when you hover the mouse pointer over such an item. You can set this style using the SiwModifyStyleEx() method of the grid.

Offer Har Mar 26, 2007 - 1:11 PM

Dear Support,

I would like to add that also in the help, the second method apply to report grid and not tree grid.

Regards,
Ron.

Offer Har Mar 26, 2007 - 12:48 PM

Dear Support,

I tried also the second method, and it does not work as well.
I think that something is missing or not implemented. Maybe it does not work because I have only one column.

Is there any working sample I can see this at work?

Regards,
Ron.

Offer Har Mar 26, 2007 - 12:15 PM

Dear Support,

Thanks for the information, but the method BestFitColumn does not work. It cuts my strings too short, it seems that there is a bug there.

All i did, is an Init() function that adds all my tree items, and when it ended, called BestFitColumn(0);

I will send you a capture of the problem by mail.

Regards,
Ron.