Filter and and edit datetimeoffset grid columns

1 Answer 278 Views
Grid
Henrik
Top achievements
Rank 1
Henrik asked on 03 May 2023, 09:29 AM

Hi,

Filtering and editing grid columns of the type datetimeoffset doesn't currently seem to be supported.

 

Is there anyway to work around this?

Currently the datetimepicker supports datetimeoffset so for consistency it should be supported in the gird aswell, is this something that will be fixed in future releases?

1 Answer, 1 is accepted

Sort by
0
Nadezhda Tacheva
Telerik team
answered on 05 May 2023, 03:46 PM

Hi Henrik,

The DateTimeOffset is a bit specific structure. It represents a date-time data structure that defines a point relative to the UTC time zone - it is a value that is not fixed.

Let me share a couple of problems with a built-in support of DateTimeOffset in the Grid:

  • Such functionality would require the Grid to automatically convert the DateTimeOffset to a specific time (like browser time). However, it may not always have to be browser time since the app may need time zones or the user might be traveling.

  • Another problem is that the DateTimeOffset is actually serialized as an object - it cannot be easily stored so the application will also have to convert it anyway.

That being said, you may post a request for such a feature in our Feedback Portal. This will let you explain your goals and requirements, even perhaps add a sample of what API and functionality you would expect it exposes. Also, you can elaborate on what is your envision on this matter and how the Grid should behave in such scenarios. If it gets good traction with the community, we will consider its implementation.

For the time being, you can use a DTO in which you can have a DateTime field converted as desired by your app from the DateTimeOffset. Filtering, sorting, editing, and grouping of DateTime values are supported out-of-the-box already.

Here is a REPL example that demonstrates this approach.

    Regards,
    Nadezhda Tacheva
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
    Tags
    Grid
    Asked by
    Henrik
    Top achievements
    Rank 1
    Answers by
    Nadezhda Tacheva
    Telerik team
    Share this question
    or