Declined
Last Updated: 21 Nov 2024 07:03 by ADMIN
Matt
Created on: 14 Nov 2024 20:54
Category: Grid
Type: Bug Report
0
No GridColumn FieldType value to display TelerikTimePiker

There seems to be no System.Type that will allow a GridColumn to be specified with the 'FieldType' attribute to receive a TelerikTimePicker

typeof(DateTime) --> TelerikDateTimePicker

typeof(?) --> TelerikTimePicker

 

<TelerikGrid Data="@gridDataExpando" Width="100%" Sortable="false" Pageable="false" Resizable="true" ShowColumnMenu="false"
             ScrollMode="@GridScrollMode.Scrollable"
             Height="100%"
             EditMode="@GridEditMode.Incell"
             OnUpdate="@UpdateHandlerExpando"
             OnEdit="@EditHandler">
   <GridColumns>
      @{
         var firstItem = gridDataExpando.FirstOrDefault();
         if (firstItem != null)
         {
            var dictionaryItem = firstItem as IDictionary<string, object>;
            foreach (var item in dictionaryItem)
            {
               if (!item.Key.Contains("Id"))
               {
                  <GridColumn Field="@(item.Key)" FieldType="@(this.GetDataType(item.Key))" Width="140px" DisplayFormat="{0:hh:mm:ss tt}">
                     <HeaderTemplate>
                        <span>@item.Key</span>
                    </HeaderTemplate>
                   </GridColumn>
               }
            }
         }
      }
   </GridColumns>
</TelerikGrid>


2 comments
ADMIN
Dimo
Posted on: 21 Nov 2024 07:03

Hi Matt,

The desired behavior depends on the EditorType parameter of the Grid column. However, when using ExpandoObject with nullable values, you need an explicit EditorTemplate.

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Matt
Posted on: 14 Nov 2024 20:59

typeof(TimeOnly) returns the Telerik Time Picker.

 

Is there a System.Type for getting the Telerik Date Time Picker that allows the user to select the time?  I am only able to select the Date when using typeof(DateTime).