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

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</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>
     
        <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" Width="1024px"  runat="server" ClientDataSourceID="RadClientDataSource1" AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true">
            <MasterTableView ClientDataKeyNames="CustomerID" EditMode="Batch" CommandItemDisplay="Top" BatchEditingSettings-HighlightDeletedRows="true">
                <Columns>
                    <telerik:GridBoundColumn DataField="CustomerID" HeaderText="Customer ID" ReadOnly="true">
                    </telerik:GridBoundColumn>
                    <%--<telerik:GridBoundColumn DataField="CompanyName" HeaderText="Company Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ContactName" HeaderText="Contact Name">
                    </telerik:GridBoundColumn>--%>

                    <telerik:GridDateTimeColumn DataField="SomeDate" HeaderText="Some Date" DataFormatString="{0:dd/MM/yyyy}" EnableRangeFiltering="true">
                    </telerik:GridDateTimeColumn>

                    <%--<telerik:GridBoundColumn DataField="ContactTitle" HeaderText="Contact Title" ColumnEditorID="GridTextBoxEditor">
                    </telerik:GridBoundColumn>--%>
                    <%--<telerik:GridTemplateColumn>
                       <ClientItemTemplate>
                           #= ContactTitle #
                       </ClientItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadTextBox ID="RadTextBox1" runat="server"></telerik:RadTextBox>
                        </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                    <telerik:GridClientDeleteColumn HeaderText="Delete">
                        <HeaderStyle Width="70px" />
                    </telerik:GridClientDeleteColumn>--%>
                    <telerik:GridEditCommandColumn>
                        <HeaderStyle Width="50px" />
                    </telerik:GridEditCommandColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

        <telerik:RadClientDataSource ID="RadClientDataSource1" runat="server" AllowBatchOperations="true">
            <DataSource>
                <WebServiceDataSourceSettings BaseUrl="EditingWcfService.svc/">
                    <Select Url="GetCustomers" DataType="JSON" />
                    <Update Url="UpdateCustomers" DataType="JSON" />
                    <Insert Url="InsertCustomers" DataType="JSON" />
                    <Delete Url="DeleteCustomers" DataType="JSON" />
                </WebServiceDataSourceSettings>
            </DataSource>
            <Schema DataName="d.Data">
                <Model ID="CustomerID">
                    <telerik:ClientDataSourceModelField FieldName="CustomerID" DataType="Number" />
                    <telerik:ClientDataSourceModelField FieldName="SomeDate" DataType="Date" />
                    <telerik:ClientDataSourceModelField FieldName="CompanyName" DataType="String" />
                    <telerik:ClientDataSourceModelField FieldName="ContactName" DataType="String" />
                    <telerik:ClientDataSourceModelField FieldName="ContactTitle" DataType="String" />
                </Model>
            </Schema>
        </telerik:RadClientDataSource>
    </form>
</body>
</html>
