<%@ Page Title="" Language="C#" MasterPageFile="~/Wijmo.Master" AutoEventWireup="true" CodeBehind="ClientSideEditing.aspx.cs" Inherits="ControlExplorer.C1GridView.Editing1" %>

<%@ Register Assembly="C1.Web.Wijmo.Controls.4" Namespace="C1.Web.Wijmo.Controls.C1GridView" TagPrefix="wijmo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
	<style type="text/css">
		.wijmo-wijgrid .wijmo-wijinput .wijmo-wijinput-trigger .ui-icon
		{
			margin-top: 0px;
		}
	</style>

	<script type="text/javascript">
		function beforeCellEdit(e, args) {
			if (args.cell.column().dataField === "ShippedDate") {
				$("<input />")
					.width("100%")
					.appendTo(args.cell.container().empty())
					.wijinputdate({
						date: args.cell.value(),
						showTrigger: true
					});

				args.handled = true;
			}
		}

		function beforeCellUpdate(e, args) {
			if (args.cell.column().dataField === "ShippedDate") {
				args.value = args.cell.container()
					.find("input")
					.wijinputdate("option", "date");
			}
		}

		function afterCellEdit(e, args) {
			if (args.cell.column().dataField === "ShippedDate") {
				args.cell.container()
					.find("input")
					.wijinputdate("destroy");
			}
		}
	</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<asp:ScriptManager ID="ScriptManager1" runat="server">
	</asp:ScriptManager>

	<wijmo:C1GridView ID="C1GridView1" runat="server"
		AutoGenerateDeleteButton="true" AllowClientEditing="true" DataKeyNames="OrderID" HighlightCurrentCell="true" ShowRowHeader="true"
		OnRowUpdating="C1GridView1_RowUpdating" OnEndRowUpdated="C1GridView1_EndRowUpdated" OnRowDeleting="C1GridView1_RowDeleting" AllowKeyboardNavigation="true"
		
		OnClientBeforeCellEdit="beforeCellEdit" OnClientBeforeCellUpdate="beforeCellUpdate" OnClientAfterCellEdit="afterCellEdit">
		<CallbackSettings Action="Editing" />
	</wijmo:C1GridView>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ControlOptions" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="Description" runat="server">
	<p><%= Resources.C1GridView.ClientSideEditing_Text0 %></p>

	<p><%= Resources.C1GridView.ClientSideEditing_Text1 %></p>
	<ul>
		<li><%= Resources.C1GridView.ClientSideEditing_Li1 %></li>
		<li><%= Resources.C1GridView.ClientSideEditing_Li2 %></li>
		<li><%= Resources.C1GridView.ClientSideEditing_Li3 %></li>
	</ul>

	<p><%= Resources.C1GridView.ClientSideEditing_Text2 %></p>
	<ul>
		<li><%= Resources.C1GridView.ClientSideEditing_Li4 %></li>
		<li><%= Resources.C1GridView.ClientSideEditing_Li5 %></li>
		<li><%= Resources.C1GridView.ClientSideEditing_Li6 %></li>
	</ul>

	<p><%= Resources.C1GridView.ClientSideEditing_Text3 %></p>
	<ul>
		<li><%= Resources.C1GridView.ClientSideEditing_Li7 %></li>
		<li><%= Resources.C1GridView.ClientSideEditing_Li8 %></li>
	</ul>

	<p><%= Resources.C1GridView.ClientSideEditing_Text4 %></p>
	<ul>
		<li><%= Resources.C1GridView.ClientSideEditing_Li9 %></li>
		<li><%= Resources.C1GridView.ClientSideEditing_Li10 %></li>
		<li><%= Resources.C1GridView.ClientSideEditing_Li11 %></li>
	</ul>

	<p><%= Resources.C1GridView.ClientSideEditing_Text5 %></p>
	<ul>
		<li><%= Resources.C1GridView.ClientSideEditing_Li12 %></li>
		<li><%= Resources.C1GridView.ClientSideEditing_Li13 %></li>
	</ul>

	<p><%= Resources.C1GridView.ClientSideEditing_Text6 %></p>

	<p><%= Resources.C1GridView.ClientSideEditing_Text7 %></p>
</asp:Content>