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 questions Collapse All
Subject Author Date
Jeremy Ruth Jan 10, 2007 - 6:56 PM

First of all, I hope it’s ok to lump more than 1 question into one thread. Please let me know if you’d rather they were separate threads. I have a bunch of GridWnd questions:

1. I have numeric cell columns that I do not want thousand separators for... is there a way to suppress the ’ThousandSeparator’ (i.e. a value of 345,543 to display as: 345543?

2. I am experiencing slow/choppy horizontal scrolling when using any of the office 2007 themes. I notice the grid sample in the ’Controls’ sample app seems to do a better job. I have tried to implement my grid the same way. The only differences I can think of are: My grid is on a CFormView and I have a lot more columns (160 for this app). Any thoughts on this?

3. Is there a thought about adding functionality for horizontal scrolling while dragging a column header to either end of the visible grid window? How could this handled programmatically? In other words, are there events I can use to get me going in the right direction?

4. The documentation help file (Very awesome, by the way!!) I have for 2.62, which I believe is the latest, is not up to date for the OnMeasureTextSize overridable. There are 3 CRect parms now in 2.63. What and how are they used?

5. Given a CExtGridCell pointer, is there a way to know the row and column?

6. I am trying with absolutely no luck to dynamically change the width of the Left Outer column (row headers). I have set the __EGCS_HDR_ROW_COLUMN_NUMBER style on the column of cells to auto number the rows. I want to dynamically change the Extent based on how many rows (largest width of all row numbers encountered). I have found examples here using OnMeasureTextSize for inner cells and column headers, but I can not get it to work for row headers.

Thanks very much for this tool. It is wonderful. The support is also very good. Keep up the great work.

Technical Support Jan 13, 2007 - 1:43 PM

1. CExtGridCellNumber class uses the information specified by the LCTYPE constant value LOCALE_STHOUSAND in the current locale. So you can use the SetLocaleInfo() method for changing this value. Please note you cannot specify the "" (empty) value using the SetThousandSeparator() method. This value is interpreted as the default value. Another way is to override the CExtGridCellNumber::OnQueryThousandSeparator( CExtSafeString & sVal ) virtual method and make the sVal parameter empty.

2. It is not clear what you mean by the "slow/choppy horizontal scrolling". If you mean the Office 2007 style of the scroll bars, please take a look at how it is done in the CMyGridWnd class in the ProfUIS_Controls sample (the PageGrid.h file)

3. This is not supported at the moment. We added this feature to our TO-DO list.

4. Thank you for the comments, we will update the documentation. These parameters were added for the future use and are not used currently.

5. The CExtGridCell object knows nothing about its location in the grid. The only one way is to traverse all the cells in the grid and compare the cell objects with your cell object. Please let us know where you are going to use the cell location? Maybe we could suggest you some better solution in your particular case.

6. There is a CExtGridBaseWnd::OuterColumnWidthSet() method that sets the width, in pixels, of the outer column on left/right.

Suhai Gyorgy Jan 12, 2007 - 4:13 AM

Partial reply:
1. Have you tried using CExtGridCellNumber::SetThousandSeparator(_T(""));? You can’t set it to the column but have to set it to every cell of the column when initializing.

5. If you knew the client coordinates of the cell then you could call CExtGridBaseWnd::HitTest() after filling out CExtGridHitTestInfo::m_ptClient member of the first parameter of the method. It will fill out the rest of the CExtGridHitTestInfo members.

6. Have you tried CExtGridWnd::BestFitColumn(0, -1) ?