<%@ Page Language="vb" AutoEventWireup="true" Inherits="Telerik.ListViewExamplesVBNet.DataEditing.NET35AutomaticDataEditing.DefaultVB"CodeFile="DefaultVB.aspx.vb" %>
<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
<title>Telerik ASP.NET Example</title>
<link href="styles.css" rel="stylesheet" />
<script type="text/javascript" src="scripts.js">
</script>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
<div class="demo-container">
<telerik:RadFormDecorator RenderMode="Lightweight" ID="RadFormDecorator1" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ListViewPanel1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ListViewPanel1"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>
<asp:Panel ID="ListViewPanel1" runat="server">
<telerik:RadListView ID="RadListView1" RenderMode="Lightweight" DataSourceID="EntityDataSource1" runat="server"
ItemPlaceholderID="ProductItemContainer" DataKeyNames="ProductID" AllowPaging="true">
<LayoutTemplate>
<fieldset id="FieldSet1">
<legend>Products</legend>
<table class="layoutTable">
<tr>
<td class="button">
<telerik:RadButton RenderMode="Lightweight" ID="Button1" runat="server" Text="Add new product" OnClick="AddNewButton_Click"
Visible="<%# Not Container.IsItemInserted %>" CausesValidation="false"></telerik:RadButton>
</td>
</tr>
<tr>
<td>
<asp:Panel ID="ProductItemContainer" runat="server">
</asp:Panel>
</td>
</tr>
<tr>
<td>
<telerik:RadDataPager RenderMode="Lightweight" ID="RadDataPager1" runat="server" PagedControlID="RadListView1"
PageSize="6">
<Fields>
<telerik:RadDataPagerButtonField FieldType="FirstPrev"></telerik:RadDataPagerButtonField>
<telerik:RadDataPagerButtonField FieldType="Numeric"></telerik:RadDataPagerButtonField>
<telerik:RadDataPagerButtonField FieldType="NextLast"></telerik:RadDataPagerButtonField>
</Fields>
</telerik:RadDataPager>
</td>
</tr>
</table>
</fieldset>
</LayoutTemplate>
<ItemTemplate>
<fieldset class="itemFieldset">
<table class="itemTable">
<tr>
<td class="cellLabel">Name:
</td>
<td class="cellInfo">
<%# Eval("ProductName") %>
</td>
</tr>
<tr>
<td>Quantity:
</td>
<td class="cellInfo">
<%# Eval("QuantityPerUnit") %>
</td>
</tr>
<tr>
<td>Price:
</td>
<td class="cellInfo">
<%# DataBinder.Eval(Container.DataItem, "UnitPrice", "{0:C}") %>
</td>
</tr>
<tr>
<td>Units:
</td>
<td class="cellInfo">
<%# Eval("UnitsInStock") %>
</td>
</tr>
<tr>
<td>Discontinued:
</td>
<td class="cellInfo">
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("Discontinued") %>'
Enabled="false"></asp:CheckBox>
</td>
</tr>
<tr>
<td colspan="2">
<telerik:RadButton RenderMode="Lightweight" ID="Button1" runat="server" CommandName="Edit" Text="Edit" CausesValidation="false"></telerik:RadButton>
<telerik:RadButton RenderMode="Lightweight" ID="Button2" runat="server" CommandName="Delete" OnClientClick="ConfirmDelete(this); return false;"
Text="Delete"></telerik:RadButton>
</td>
</tr>
</table>
</fieldset>
</ItemTemplate>
<EditItemTemplate>
<fieldset class="itemFieldset">
<table class="itemTable">
<tr>
<td class="cellLabel">Name:
</td>
<td class="cellInfo">
<telerik:RadTextBox RenderMode="Lightweight" ID="TextBox1" runat="server" Text='<%# Bind("ProductName") %>' Width="120px"></telerik:RadTextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
ControlToValidate="TextBox1"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>Quantity:
</td>
<td class="cellInfo">
<telerik:RadTextBox RenderMode="Lightweight" ID="TextBox2" runat="server" Text='<%# Bind("QuantityPerUnit") %>' Width="120px"></telerik:RadTextBox>
</td>
</tr>
<tr>
<td>Price:
</td>
<td class="cellInfo">
<telerik:RadNumericTextBox RenderMode="Lightweight" ID="TextBox3" runat="server" Text='<%# Bind("UnitPrice") %>'
Width="80px" MinValue="0" MaxValue="999">
</telerik:RadNumericTextBox>
</td>
</tr>
<tr>
<td>Units:
</td>
<td class="cellInfo">
<telerik:RadNumericTextBox RenderMode="Lightweight" ID="TextBox4" runat="server" Text='<%# Bind("UnitsInStock") %>'
Width="80px" MinValue="0" MaxValue="100">
</telerik:RadNumericTextBox>
</td>
</tr>
<tr>
<td>Discontinued:
</td>
<td class="cellInfo">
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Discontinued") %>'></asp:CheckBox>
</td>
</tr>
<tr>
<td colspan="2">
<telerik:RadButton RenderMode="Lightweight" ID="Button1" runat="server" CommandName="Update" Text="Update"></telerik:RadButton>
<telerik:RadButton RenderMode="Lightweight" ID="Button2" runat="server" CommandName="Cancel" Text="Cancel" CausesValidation="false"></telerik:RadButton>
</td>
</tr>
</table>
</fieldset>
</EditItemTemplate>
<InsertItemTemplate>
<fieldset class="itemFieldset">
<table class="itemTable">
<tr>
<td class="cellLabel">Name:
</td>
<td class="cellInfo">
<telerik:RadTextBox RenderMode="Lightweight" ID="TextBox1" runat="server" Width="120px" Text='<%# Bind("ProductName") %>'></telerik:RadTextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
ControlToValidate="TextBox1"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>Quantity:
</td>
<td class="cellInfo">
<telerik:RadTextBox RenderMode="Lightweight" ID="TextBox2" runat="server" Width="120px" Text='<%# Bind("QuantityPerUnit") %>'></telerik:RadTextBox>
</td>
</tr>
<tr>
<td>Price:
</td>
<td class="cellInfo">
<telerik:RadNumericTextBox RenderMode="Lightweight" ID="TextBox3" runat="server" Width="80px" MinValue="0" MaxValue="999" Text='<%# Bind("UnitPrice") %>'>
</telerik:RadNumericTextBox>
</td>
</tr>
<tr>
<td>Units:
</td>
<td class="cellInfo">
<telerik:RadNumericTextBox RenderMode="Lightweight" ID="TextBox4" runat="server" Width="80px" MinValue="0" MaxValue="100" Text='<%# Bind("UnitsInStock") %>'>
</telerik:RadNumericTextBox>
</td>
</tr>
<tr>
<td>Discontinued:
</td>
<td class="cellInfo">
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Discontinued") %>'></asp:CheckBox>
</td>
</tr>
<tr>
<td colspan="2">
<telerik:RadButton RenderMode="Lightweight" ID="Button1" runat="server" CommandName="PerformInsert" Text="Insert"></telerik:RadButton>
<telerik:RadButton RenderMode="Lightweight" ID="Button2" runat="server" CommandName="Cancel" Text="Cancel" CausesValidation="false"></telerik:RadButton>
</td>
</tr>
</table>
</fieldset>
</InsertItemTemplate>
</telerik:RadListView>
</asp:Panel>
<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=NorthwindReadWriteEntities"
DefaultContainerName="NorthwindReadWriteEntities" EntitySetName="Products" EnableDelete="True"
EnableInsert="True" EnableUpdate="True" AutoGenerateWhereClause="True">
</asp:EntityDataSource>
<telerik:RadWindowManager RenderMode="Lightweight" ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>
</div>
</form>
</body>
</html>