<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
            function OnBatchEditOpening(sender, args) {

            }

            function OnBatchEditOpened(sender, args) {

            }

            function rowMouseOver(sender, args) {

            }

            function CustomValidateMethod(source, arguments) {
                
                if (0 != 1) {
                    arguments.IsValid = false;
                }

                //alert("Custom Validation fired");
            }
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <div>

            <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0" GridLines="None" Height="600px" PageSize="50" AllowAutomaticInserts="True"
                AllowAutomaticUpdates="True"
                OnNeedDataSource="RadGrid1_NeedDataSource"
                OnItemDataBound="RadGrid1_ItemDataBound"
                OnBatchEditCommand="RadGrid1_BatchEditCommand"
                ValidationSettings-EnableValidation="true">
                <%----%>
                <ClientSettings Virtualization-LoadingPanelID="RadAjaxLoadingPanel1">
                    <Scrolling AllowScroll="true" UseStaticHeaders="True" SaveScrollPosition="true" />
                    <ClientEvents OnBatchEditOpening="OnBatchEditOpening" OnBatchEditOpened="OnBatchEditOpened" OnRowMouseOver="rowMouseOver" />
                </ClientSettings>
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="OrderID" EditMode="Batch" CommandItemDisplay="Top"
                    CommandItemSettings-ShowRefreshButton="false">
                    <BatchEditingSettings EditType="Cell" />
                    <Columns>

                        <telerik:GridTemplateColumn UniqueName="AccidentDate" DataField="AccidentDate" HeaderText="Accident Date" DataType="System.DateTime">
                            <ItemTemplate>
                                <telerik:RadLabel ID="lblAcdntDt" runat="server" Text='<%# Eval("OrderDate").ToString() %>' Width="100px"></telerik:RadLabel>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadDatePicker ID="rdpAcdntDt" runat="server" DateInput-EmptyMessage="Select Date" OnPreRender="rdpAcdntDt_PreRender">
                                </telerik:RadDatePicker>

                                <asp:CustomValidator runat="server" ID="cvAcdntDt"
                                    ControlToValidate="rdpAcdntDt"
                                    ClientValidationFunction="CustomValidateMethod"
                                    ForeColor="Red" ErrorMessage="*Order Date is required"
                                    Display="Dynamic">
                                </asp:CustomValidator>


                                <%--<asp:RequiredFieldValidator runat="server" ID="rfvAcdntDt" ControlToValidate="rdpAcdntDt"
                                                ForeColor="Red" ErrorMessage="*Accident Date is required" Display="Dynamic" ></asp:RequiredFieldValidator>--%>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowKeyboardNavigation="true">
                </ClientSettings>
            </telerik:RadGrid>
        </div>
    </form>
</body>
</html>
