Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
DateTimeEditorProvider does not properly display just hour:minute in Edit Mode.
posted

I cannot get a DateTimeEditorProvider to properly display just hour:minute in Edit Mode.
I added a date/time column to Products table in the Northwind database.
I modified the ReadOnly sample and added a date/time column. 
I added a DateTimeEditorProvider and assigned it to the new date/time column.
I need the Edit format to display hours:minutes. 
However in each of my attempts, it will display the month/day as hour:minute.
Here is my code:
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div>
        <ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="500px" Width="800px" DataKeyFields="ProductID"
            DataSourceID="AccessDataSource1" AutoCRUD="false" AutoGenerateColumns="false">
            <EditorProviders>
                <ig:DateTimeEditorProvider ID="WebDateTimeEdit1" runat="server"
                    EditorControl-DisplayModeFormat="{0:g}"
                    EditorControl-EditModeFormat="t">
                </ig:DateTimeEditorProvider>
            </EditorProviders>
            <Columns>
                <ig:BoundDataField DataFieldName="ProductID" Key="ProductID" Width="100px" Header-Text="Product ID"></ig:BoundDataField>
                <ig:BoundDataField DataFieldName="ProductName" Key="ProductName" Width="100px" Header-Text="Product Name"></ig:BoundDataField>
                <ig:BoundDataField DataFieldName="UnitPrice" Key="UnitPrice" Width="150px" Header-Text="Unit Price"></ig:BoundDataField>
                <ig:BoundDataField DataFieldName="UnitsInStock" Key="UnitsInStock" Width="100px" Header-Text="Units In Stock"></ig:BoundDataField>
                <ig:BoundDataField DataFieldName="DiscontinuedDate" Key="DiscontinuedDate"  Width="200px"
                    DataFormatString="{0:g}" DataType="System.DateTime"
                    Header-Text="Discontinued Date">
                </ig:BoundDataField>
            </Columns>
            <Behaviors>
                <ig:EditingCore>
                    <Behaviors>
                        <ig:CellEditing>
                            <ColumnSettings>
                                <ig:EditingColumnSetting ColumnKey="DiscontinuedDate" EditorID="WebDateTimeEdit1"/>
                            </ColumnSettings>
                            <EditModeActions MouseClick="Single" />
                        </ig:CellEditing>
                    </Behaviors>
                </ig:EditingCore>
            </Behaviors>
        </ig:WebDataGrid>
    </div>
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb"
        SelectCommand="SELECT ProductID, ProductName, UnitPrice, UnitsInStock, DiscontinuedDate  FROM [Products] "></asp:AccessDataSource>
    </form>

Parents
No Data
Reply Children