Professional UI Solutions
Site Map   /  Register


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 General Discussion » BestFitRow() and BestFitColumn() in CExtReportGrid Ver 2.64 Collapse All
Subject Author Date
Gunasekaran Velu May 24, 2007 - 11:02 PM

Hi folks

I am using ReportGrid version 2.64 in my application. How can i access BestFitRow() and BestFitColumn() function. I used the following code
m_WndGrid.BestFitRow(true); // m_WndGrid is member variable of CExtReportGrid



but still my grid column does not fit into the coulumn data. Help me...

Thanks and Regards

Technical Support May 26, 2007 - 11:34 AM

The rows in the report grid window are automatically fit their content and you don’t have to resize it manually.

The CExtGridWnd::BestFitColumn() method uses plain column indices to resize the column. But the CExtReportGridWnd control uses the CExtReportGridColumn* pointers as unique column identifiers. Besides columns can be active(visible) and inactive(invisible). So first of all, you should find the report column in the report grid’s header area. The CExtGridWnd::ColumnCountGet() method returns the number of active(visible) columns for the report grid window. You should get a pointer to each active(visible) header column using the CExtGridWnd::GridCellGetOuterAtTop() method and querying the range of columns from zero to CExtGridWnd::ColumnCountGet()-1. The returned CExtGridCell* pointers are really the CExtReportGridColumn* pointers. So, you can find the index of the report column and the invoke the CExtGridWnd::BestFitColumn() method for it.