This is a migrated thread and some comments may be shown as answers.

Grid Column display time only

7 Answers 217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Artem
Top achievements
Rank 1
Veteran
Artem asked on 01 Sep 2020, 05:39 PM

Hi,

I have a grid with StartTime column, the source object for the grid has a property DateTime

I can handle this using Template and format the output of the DateTime, showing time only

<GridColumn Field=@nameof(DtoRead.Shift.EndTime) Title="@LanguageContainer.Keys["MasterDataEndTime"]" Editable="false" Width="@ColumnSize.S">
    <Template>
        @((context as DtoRead.Shift).EndTime?.ToString(@"hh\:mm", System.Globalization.CultureInfo.CurrentCulture))
    </Template>
</GridColumn>

 

when Grid is loaded with data, I have filter on top of this column and it shows DatePicker control

I want to show a Time Picker instead... how to do this?

I want to see time only and filter time only values

 

Thanks,

Artem

 

 

7 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 01 Sep 2020, 05:43 PM

Hello Artem,

I first suggest you review this article on properly setting the Field of the column so it can work with nested objects: https://docs.telerik.com/blazor-ui/knowledge-base/grid-bind-navigation-property-complex-object.

As for a TimePicker - at the moment you can do this through a FilterTemplate: https://docs.telerik.com/blazor-ui/components/grid/templates/filter. You can also Follow this enhancement that will provide a feature on the grid for such a switch: https://feedback.telerik.com/blazor/1454076-filter-date-time-in-grid.

You may also find interesting this one for easier formatting of data: https://feedback.telerik.com/blazor/1451067-add-attribute-format-for-grid-column-to-apply-c-standard-formats.

I've added your Vote for both of them on your behalf to raise their priority.

Regards,
Marin Bratanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

0
Artem
Top achievements
Rank 1
Veteran
answered on 01 Sep 2020, 05:52 PM

Hi Marin,

thanks for this information, I will take a look.

Another question,

is there a possibility to remove filter from specific column?

so for example I have FilterMode="@GridFilterMode.FilterRow"

but I want some columns do not have any filters.. is this possible?

 

Thanks,

Artem

0
Accepted
Marin Bratanov
Telerik team
answered on 01 Sep 2020, 05:55 PM

Hi Artem,

You can simply set the Filterable parameter of such columns to False.

You can read more about the filtering behavior here and about the parameters a column offers here.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Artem
Top achievements
Rank 1
Veteran
answered on 01 Sep 2020, 05:59 PM

Thank you.

 

That works.

0
Artem
Top achievements
Rank 1
Veteran
answered on 01 Sep 2020, 06:07 PM

Regarding the Time Picker for column filter, do you know when this feature will be available?

Approx release date?

 

Thanks,

Artem

0
Marin Bratanov
Telerik team
answered on 01 Sep 2020, 07:00 PM

Hello Artem,

The best way to get status updates is to click the Follow button and you will receive emails when something changes. When we know the release in which a feature or a fix will be implemented, the portal page gets updated with its number and you will receive an email.

 

Regards,
Marin Bratanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

0
Marin Bratanov
Telerik team
answered on 02 May 2021, 07:05 AM

Hi Artem,

There is a new feature request about changing the format more easily that you can Follow here, I've added your Vote for you.

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Artem
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
Artem
Top achievements
Rank 1
Veteran
Share this question
or