Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
TimeWithSpin style makes the field read-only, and doesn't show the existing value?
posted

In the database the column is set to "time(0)" type. (sql 2008) there are values in that column, like 23:15:00

In ultrawingrid if I set leave the style for this column "default", it displays the correct value as 23:15:00, and it can be edited.

If I set the style to "time" or "timewithspin", the value doesn't show up only some separator characters like "//", the cell cannot be edited and there is no little arrow for spinning anything.

Is this a bug or I'm missing something?

The goal is to show the time in this column, be able to edit it, possibly with the "timewithspin" control. (ad if I can ask something extra, display only the hour and minute, hh:mm, and not like the current hh:mm:ss format.

 

Thanks,

Rudi

 

Parents
  • 469350
    Offline posted

    Hi Rudi,

    What is the DataType of the grid column? It sounds to me like your data source is returning the data in some unusual type that the grid doesn't know how to deal with.

    I tried it out with a column whose DataType is DateTime and it works just fine for me in v9.2 of the grid.

     

  • 69832
    Offline posted in reply to Rudi

    The 'TIME' datatype is new to SQLServer 2008; according to MSDN documentation on SQL-CLR type mapping for dates/times, it maps to the System.TimeSpan data type. I checked UltraGrid's implementation for the 'Time' and 'TimeWithSpin' column types, and it is expecting a DateTime data type, so that is not the correct column type to use.

    Coincidentally, our 2010.2 release includes a new control, UltraTimeSpan editor, which can provide an embeddable editor to the grid (by assigning an UltraTimeSpan instance to a column's EditorComponent property). This control ( the the embedded editor it provides) will give the user the ability to edit time spans, although it was patterned after an editor used in MS Project to edit the duration of a task. The user can enter values like "1.5 hours" or "10min", and the editor will parse the typed input into a TimeSpan struct. It also shows spin buttons by default, which increment/decrement by one unit of time when they are clicked.

    Note, however, that this editor does not use our masking functionality as does the DateTimeEditor, so you cannot specify a format like "hh:mm".

Reply Children
No Data