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

RadGrid Date Format stop postback

5 Answers 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Emad Mokhtar
Top achievements
Rank 1
Emad Mokhtar asked on 13 May 2013, 06:49 AM
Dear,

I'm developing Time Attendance application so it's using Dates and Time a lot and I created a Grid that has Date fields in it. In Edit or Insert mode if I input 1/1/2013 it work but if I input 31/8/2013 insert/update button won't perform postback, I tried to set the Culture and UICulture to 'en-GB' still not working, and my default Culture is 'en-US' but I need the date input format to be dd/MM/yyyy because I'm developing this application for middle east. 
What is wrong? Am I missing something?

And another one simple request can you provide a resource how to be Ninja in RadGrid I want to learn every event and every single feature in RadGrid.


RadGrid Code:
<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" DataSourceID="obsShiftPeriods" GridLines="None" Skin="Metro" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
    <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="False"
        DataSourceID="obsShiftPeriods" DataKeyNames="ShiftId,PeriodId">
        <CommandItemSettings ExportToPdfText="Export to PDF" />
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="3%">
                <HeaderStyle Width="3%" />
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn
                CommandName="Delete"
                Text="Delete"
                UniqueName="DeleteColumn" ButtonType="ImageButton" ImageUrl="~/images/delete.png" ConfirmText="Are you sure?">
            </telerik:GridButtonColumn>
            <telerik:GridDateTimeColumn DataField="DateFrom" DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime" FilterControlAltText="Filter DateFrom column" HeaderText="Date From" UniqueName="DateFrom">
            </telerik:GridDateTimeColumn>
            <telerik:GridDateTimeColumn DataField="DateTo" DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime" FilterControlAltText="Filter DateTo column" HeaderText="Date To" UniqueName="DateTo">
            </telerik:GridDateTimeColumn>
            <telerik:GridDateTimeColumn DataField="TimeIn" DataType="System.DateTime" DataFormatString="{0:hh:mm tt}" FilterControlAltText="Filter TimeIn column" HeaderText="Time In" PickerType="TimePicker" UniqueName="TimeIn">
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="GraceIn" DataType="System.Int32" FilterControlAltText="Filter GraceIn column" HeaderText="GraceIn" SortExpression="GraceIn" UniqueName="GraceIn">
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn DataField="TimeOut" DataType="System.DateTime" DataFormatString="{0:hh:mm tt}" FilterControlAltText="Filter TimeOut column" HeaderText="Time Out" PickerType="TimePicker" UniqueName="TimeOut">
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="GraceOut" DataType="System.Int32" FilterControlAltText="Filter GraceOut column" HeaderText="GraceOut" SortExpression="GraceOut" UniqueName="GraceOut">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="OverTimeStart" DataType="System.Int32" FilterControlAltText="Filter OverTimeStart column" HeaderText="OverTimeStart" SortExpression="OverTimeStart" UniqueName="OverTimeStart">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="AbsertAfter" DataType="System.Int32" FilterControlAltText="Filter AbsertAfter column" HeaderText="AbsertAfter" SortExpression="AbsertAfter" UniqueName="AbsertAfter">
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn DataField="Night" DataType="System.Boolean" FilterControlAltText="Filter Night column" HeaderText="Night" SortExpression="Night" UniqueName="Night">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Sat" DataType="System.Boolean" FilterControlAltText="Filter Sat column" HeaderText="Sat" SortExpression="Sat" UniqueName="Sat">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Sun" DataType="System.Boolean" FilterControlAltText="Filter Sun column" HeaderText="Sun" SortExpression="Sun" UniqueName="Sun">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Mon" DataType="System.Boolean" FilterControlAltText="Filter Mon column" HeaderText="Mon" SortExpression="Mon" UniqueName="Mon">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Tue" DataType="System.Boolean" FilterControlAltText="Filter Tue column" HeaderText="Tue" SortExpression="Tue" UniqueName="Tue">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Wed" DataType="System.Boolean" FilterControlAltText="Filter Wed column" HeaderText="Wed" SortExpression="Wed" UniqueName="Wed">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Thu" DataType="System.Boolean" FilterControlAltText="Filter Thu column" HeaderText="Thu" SortExpression="Thu" UniqueName="Thu">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Fri" DataType="System.Boolean" FilterControlAltText="Filter Fri column" HeaderText="Fri" SortExpression="Fri" UniqueName="Fri">
            </telerik:GridCheckBoxColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
</telerik:RadGrid>
Update1:

I logged error in Google Chrome
please view the image in attachments

5 Answers, 1 is accepted

Sort by
0
Emad Mokhtar
Top achievements
Rank 1
answered on 14 May 2013, 07:01 AM
I found that ObjectdataSource is always using en-US culture and that's way it thrown an exception, please view this link for a workaround done with ASP.NET GridView, so how to apply this workaround on RadGrid.
0
Daniel
Telerik team
answered on 16 May 2013, 07:19 AM
Hello Emad,

You can just change the page Culture to the desired one and RadGrid will start using it.
<%@ Page Language="C#" ... Culture="en-GB" %>

If you need a tutorial, you can examine the following link:
Step-by-step tutorial

Regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Emad Mokhtar
Top achievements
Rank 1
answered on 16 May 2013, 11:23 AM
I tried the solution but didn't solve the problem.
I googled the issue and most of the links said it's a bug in ObjectDataSoruce.
0
Daniel
Telerik team
answered on 21 May 2013, 11:46 AM
Hello Emad,

I would recommend that you try to specify the update parameters with the corresponding types in the ODS declaration. I attached a runnable demo to this ticket. Let me know whether it behaves properly on your end.

Best regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Emad Mokhtar
Top achievements
Rank 1
answered on 22 May 2013, 11:46 AM
Thank you very much I'm really really happy, thanks
Tags
Grid
Asked by
Emad Mokhtar
Top achievements
Rank 1
Answers by
Emad Mokhtar
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or