Integration with WebInput (DateTime)

1 reply. Last post: October 26, 2010 9:57 AM by Niven Prasetya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Kenny YungMember

Dear,

I have encountered problem when I try to use a WebInput as a DatePicker in the WebGrid.

I have enabled DateTimeEditor and EditFormat for the WebInput, it works fine when I select date from the DateTimeEditor. However, when I try to populated the field manually (e.g. 10-OCT-10) then press either TAB/Enter, the value disappears from the WebInput. Can you tell me what change I have to make to get this work?

Moreover, when I run the same piece of code in Mozilla(Firefox), the DateTimeEditor doesn't work at all. After I have selected a date from the Editor, the value always becomes Today date.

 

The following is my code

    <form id="form1" runat="server">
        <div>
            <ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="252px" UseDefaultStyle="True"
        Width="745px" DataSourceID="SqlDataSource1" DefaultStyleMode="Black">
                <LayoutSettings AllowEdit="Yes" AllowBatchUpdate="True" EditOnClick="True" 
                    ResetNewRowValuesOnError="False" VerboseEditingInformation="True">
                    <BatchUpdateSettings AllowReviewChanges="True" AutomaticObjectUpdate="False" 
                        NotifyOnLostFocus="True" />
<BatchUpdateSettings AllowReviewChanges="True" AutomaticObjectUpdate="False" NotifyOnLostFocus="True"></BatchUpdateSettings>
                </LayoutSettings>
                <RootTable>
                    <Columns>
                        <ISWebGrid:WebGridColumn Caption="id" DataMember="id" DataType="System.Int32" 
                            Name="id" Width="100px">
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="name" DataMember="name" Name="name" 
                            Width="100px">
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="address" DataMember="address" Name="address" 
                            Width="100px">
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="phone" DataMember="phone" Name="phone" 
                            Width="100px">
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="active" DataMember="active" 
                            DataType="System.Int32" Name="active" Width="100px">
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="dob" ColumnType="Custom" 
                            CustomEditorName="WebInputNET" 
                            DataMember="dob" EditType="Custom" Name="dob" DataFormatString="dd-MMM-yy"
                            Width="100px" CustomEditorServerId="WebInput1">
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="port" DataMember="port" 
                            DataType="System.Int32" Name="port" Width="100px">
                        </ISWebGrid:WebGridColumn>
                    </Columns>
                </RootTable>
                <FlyPostBackSettings PostHiddenFields="False" PostViewState="False" />

<FlyPostBackSettings PostViewState="False" PostHiddenFields="False"></FlyPostBackSettings>
    </ISWebGrid:WebGrid>
            <asp:SqlDataSource ...></asp:SqlDataSource>
 
            <ISWebInput:WebInput ID="WebInput1" runat="server" DecimalSeparator="" 
                MaxDate="12/31/9998 23:59:59" MinDate="1753-01-01">
                <HighLight IsEnabled="True" Type="Phrase" />
                <editformat format="dd-MMM-yy" isenabled="True" maxdropdownyear="2050" 
                    mindropdownyear="1950">
                    <MaskInfo MaskExpression="00-LLL-00">
                    </MaskInfo>
                </editformat>

<DisplayFormat>
<ErrorWindowInfo IsEnabled="False"></ErrorWindowInfo>
</DisplayFormat>

<DateTimeEditor DateInputLink="" isenabled="True">
<DropDownYearFrameStyle BackColor="#FFFFFF" BorderColor="Black" BorderWidth="1px"></DropDownYearFrameStyle>

<DropDownMonthFrameStyle BackColor="#FFFFFF" BorderColor="Black" BorderWidth="1px"></DropDownMonthFrameStyle>
</DateTimeEditor>

<CultureInfo CultureName="en-US"></CultureInfo>
            </ISWebInput:WebInput>
 
        </div>
    </form>

Thanks

Kenny

All times are GMT -5. The time now is 11:22 PM.
Previous Next