locked
Win mobile v5.0 and Win mobile 6 : different behaviour in datagrid RRS feed

  • Question

  • I hope no to be O.T.
    I have two HpIpaQ : one with Win mob 5.1.1702, the other Win mob 5.2.1711
    I deployed my mobile appl for pocket pc (developed with VS2005) on both.
    They have different way of exposing data in grid.
    One column length 14, contains string data : "qqqqq qqqqq qqqqq"
    Palm with Win mob 6 exposes  correctly "qqqqq qqqqq qq" ,
    palm with Win mob 5 exposes  "qqqqq qqqqq    "  and all the rest is truncated.
    Any ideas?
    Thanks
    i_m_lungomare
    Tuesday, March 31, 2009 11:31 AM

Answers

  • DataGrid just uses Graphics.DrawString() to represent text. That method can use different ways of truncating strings based on device settings, e.g. locale. In some cases that would truncate string on word boundary (which is what your WM 5 device does and which, I would say, most common), some would cut the word in the middle (which is what your WM 6 device does for some reason).

    If you want it to be the same then override cell painting and draw text in a way you want.

     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by i_m_lungomare Tuesday, March 31, 2009 6:54 PM
    • Unmarked as answer by i_m_lungomare Tuesday, March 31, 2009 6:54 PM
    • Marked as answer by warrentang Monday, April 6, 2009 2:57 AM
    Tuesday, March 31, 2009 6:48 PM

All replies

  • These devices probably have different screen sizes, thus column width is different and fits different number of characters. Different font is another possibility.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, March 31, 2009 3:59 PM
  • Thank'you Ilya but there's still something i don't understand

    For example if i try to display "QQ QQQQQQQQQQQQQQQQQQ" which is surely wider  then the column lenght in both pda:

                               win 6 ->  "QQ QQQQQQQ"
                               win 5 ->  "QQ                 "

     If the string contains blank every char coming after is truncated.

     if i replace blank with '.' the same number of char are displayed in both pda.

                               win 6 ->  "QQ.QQQQQQQ"
                               win 5 ->  "QQ.QQQQQQQ"

    I don't think this depends on screen sizes

      
    i_m_lungomare
    Tuesday, March 31, 2009 5:22 PM
  • DataGrid just uses Graphics.DrawString() to represent text. That method can use different ways of truncating strings based on device settings, e.g. locale. In some cases that would truncate string on word boundary (which is what your WM 5 device does and which, I would say, most common), some would cut the word in the middle (which is what your WM 6 device does for some reason).

    If you want it to be the same then override cell painting and draw text in a way you want.

     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by i_m_lungomare Tuesday, March 31, 2009 6:54 PM
    • Unmarked as answer by i_m_lungomare Tuesday, March 31, 2009 6:54 PM
    • Marked as answer by warrentang Monday, April 6, 2009 2:57 AM
    Tuesday, March 31, 2009 6:48 PM