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

Using RadInputManager->DateInputSetting for dealing with time only

1 Answer 38 Views
Input
This is a migrated thread and some comments may be shown as answers.
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Veteran
DoomerDGR8 asked on 14 Nov 2010, 04:41 PM
Hello guys. I'm attempting to tackle a situation where, in the database, there are three columns in a table called JobDate, StartTime, and EndTime. StartTime and EndTime are also stored as a smalldatetime like JobDate. Also, the date portion of StartTime and EndTime is equal to JobDate.

Now, upon clicking the Edit Icon, I see the results as shown in "step-01". Although the values are correct, it still shows up as incorrect. Upon clicking either of the two field while in edit mode, the results achieved are shown in "step-02".

I don't want to show the date portion while editing StartTime and EndTime. This because the date portion will be same as JobDate and a JobDate cannot be changed. Not even by an accident.

Kindly help.

<telerik:RadGrid ID="RadGridJobs" runat="server" AutoGenerateColumns="False" AllowPaging="True" PageSize="25" AllowSorting="false" GridLines="None" Width="885px" Skin="Office2007" SkinID="RadGrid_UnPageable" OnNeedDataSource="RadGridJobs_NeedDataSource" OnUpdateCommand="RadGridJobs_UpdateCommand" OnDeleteCommand="RadGridJobs_DeleteCommand" OnItemCreated="RadGridJobs_ItemCreated">
<MasterTableView ClientDataKeyNames="OID" DataKeyNames="OID" CommandItemDisplay="Top">
  <Columns>
    <telerik:GridBoundColumn DataField="PharmacyName" HeaderText="Pharmacy" ReadOnly="True" SortExpression="PharmacyName"
      UniqueName="columnPharmacy" />
    <telerik:GridBoundColumn DataField="CoordinatorName" HeaderText="Coordinator" ReadOnly="true" SortExpression="CoordinatorName"
      UniqueName="columnCoordinator" />
    <telerik:GridBoundColumn DataField="JobDate" HeaderText="Date" ReadOnly="true" SortExpression="JobDate"
      UniqueName="columnDate" DataType="System.DateTime" DataFormatString="{0:dd-MMM-yyyy}" />
    <telerik:GridBoundColumn DataField="StartTime" HeaderText="Start" UniqueName="columnStart" DataType="System.DateTime"
      DataFormatString="{0:hh:mm tt}" />
    <telerik:GridBoundColumn DataField="EndTime" HeaderText="End" UniqueName="columnEnd" DataType="System.DateTime"
      DataFormatString="{0:hh:mm tt}" />
    <telerik:GridBoundColumn DataField="Rate" HeaderText="Rate" UniqueName="columnRate" DataType="System.Decimal"
      DataFormatString="{0:c}" />
    <telerik:GridBoundColumn DataField="RatePlus" HeaderText="Rate +" UniqueName="columnRatePlus" DataType="System.Decimal"
      DataFormatString="{0:c}" />
    <telerik:GridEditCommandColumn ButtonType="ImageButton" />
    <telerik:GridButtonColumn ConfirmText="Delete this Job?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete"
      ButtonType="ImageButton" CommandName="Delete" />
    <telerik:GridTemplateColumn HeaderText="" UniqueName="NoteColumn" HeaderStyle-Width="10px" ItemStyle-Width="10px">
      <ItemTemplate>
    <a href="../Notes/NotesManager.aspx?RecordID=<%# Eval("OID") %>&NoteTypeID=3">
      <asp:Image ID="ImageEditNote" runat="server" ImageUrl="~/Images/notes-icon.gif" AlternateText="Add notes"
        Width="15px" ToolTip="Add notes" />
    </a>
      </ItemTemplate>
      <HeaderStyle Width="10px"></HeaderStyle>
      <ItemStyle Width="10px"></ItemStyle>
    </telerik:GridTemplateColumn>
  </Columns>
  <EditFormSettings>
    <EditColumn ButtonType="ImageButton" />
  </EditFormSettings>
  <CommandItemSettings ShowRefreshButton="true" ShowAddNewRecordButton="false" ShowExportToWordButton="false"
    ShowExportToExcelButton="true" ShowExportToPdfButton="true" ShowExportToCsvButton="true" />
  <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" Position="TopAndBottom" />
</MasterTableView>
<ExportSettings HideStructureColumns="false" />
<ClientSettings>
  <Selecting AllowRowSelect="True" />
  <ClientEvents OnRowDblClick="RadGridJobs_OnRowDblClick" />
  <Scrolling UseStaticHeaders="True" />
</ClientSettings>
</telerik:RadGrid>
 
<telerik:RadInputManager runat="server" ID="RadInputManagerJobs" Enabled="true">
  <telerik:DateInputSetting BehaviorID="DateInputSettingStartEnd" DateFormat="hh:mm:ss tt"  DisplayDateFormat="hh:mm tt" EmptyMessage="Cannot be empty" ErrorMessage="Enter valid time" />
  <telerik:NumericTextBoxSetting BehaviorID="NumericTextBoxSettingRate" Type="Currency" AllowRounding="true" DecimalDigits="2" MinValue="0" EmptyMessage="Cannot be empty" ErrorMessage="Enter valid currency" />
</telerik:RadInputManager>

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 18 Nov 2010, 08:55 AM
Hello Hassan,

I took your sample markup and added it in a test page with some simple data. The date time input setting seems to work OK. Attaching the page I have used for testing. Can you try to reproduce this issue in it?

Regards,
Veli
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Input
Asked by
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Veli
Telerik team
Share this question
or