<%@ Page AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.ComboboxExamplesCS.ComboInGrid.DefaultCS"
	Language="c#" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
</head>
<body class="BODY">
	<form runat="server" id="mainForm" method="post" style="width: 100%;">
		<asp:ScriptManager ID="ScriptManager1" runat="server" />
		<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
			<AjaxSettings>
				<telerik:AjaxSetting AjaxControlID="RadGrid1">
					<UpdatedControls>
						<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
					</UpdatedControls>
				</telerik:AjaxSetting>
			</AjaxSettings>
		</telerik:RadAjaxManager>
		<telerik:RadGrid ID="RadGrid1" GridLines="None" AutoGenerateColumns="false" PageSize="10"
			Width="97%" AllowPaging="true" AllowSorting="true" runat="server" Skin="Telerik"
			DataSourceID="SessionDataSource1" AllowAutomaticUpdates="true">
			<MasterTableView ShowFooter="false" DataKeyNames="CustomerID" EditMode="InPlace">
				<Columns>
					<telerik:GridBoundColumn ReadOnly="True" DataField="CustomerID" HeaderText="CustomerID">
					</telerik:GridBoundColumn>
					<telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="CompanyName"
						SortExpression="CompanyName">
						<FooterTemplate>Template footer</FooterTemplate>
						<FooterStyle VerticalAlign="Middle" HorizontalAlign="Center" />
						<ItemTemplate>
							<%#DataBinder.Eval(Container.DataItem,"CompanyName")%>
						</ItemTemplate>
						<EditItemTemplate>
							<telerik:RadComboBox DataTextField="CompanyName" DataValueField="CompanyName" OnItemsRequested="RadComboBox1_ItemsRequested"
								EnableLoadOnDemand="True" ID="RadComboBox1" runat="server" Height="140px" Width="150px"
								Skin="Telerik" Text='<%#Bind("CompanyName") %>' ShowMoreResultsBox=true >
							</telerik:RadComboBox>
						</EditItemTemplate>
					</telerik:GridTemplateColumn>
					
					<telerik:GridEditCommandColumn FooterText="EditCommand footer" UniqueName="EditCommandColumn"
						HeaderText="Edit">
					</telerik:GridEditCommandColumn>
				</Columns>
			</MasterTableView>
		</telerik:RadGrid>
		<asp:SqlDataSource ID="SessionDataSource1" runat="server"
		
			ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
		 DeleteCommand="DELETE FROM [Customers] WHERE [CustomerID] = @CustomerID"
			InsertCommand="INSERT INTO [Customers] ([CustomerID], [CompanyName], [ContactName], [ContactTitle], [Address], [City], [Region], [PostalCode], [Country], [Phone], [Fax]) VALUES (@CustomerID, @CompanyName, @ContactName, @ContactTitle, @Address, @City, @Region, @PostalCode, @Country, @Phone, @Fax)"
			SelectCommand="SELECT * FROM [Customers]"
			UpdateCommand="UPDATE [Customers] SET [CompanyName] = @CompanyName, [ContactName] = @ContactName, [ContactTitle] = @ContactTitle, [Address] = @Address, [City] = @City, [Region] = @Region, [PostalCode] = @PostalCode, [Country] = @Country, [Phone] = @Phone, [Fax] = @Fax WHERE [CustomerID] = @CustomerID">
			<UpdateParameters>
				<asp:Parameter Name="CompanyName" Type="String" />
				<asp:Parameter Name="ContactName" Type="String" />
				<asp:Parameter Name="ContactTitle" Type="String" />
				<asp:Parameter Name="Address" Type="String" />
				<asp:Parameter Name="City" Type="String" />
				<asp:Parameter Name="Region" Type="String" />
				<asp:Parameter Name="PostalCode" Type="String" />
				<asp:Parameter Name="Country" Type="String" />
				<asp:Parameter Name="Phone" Type="String" />
				<asp:Parameter Name="Fax" Type="String" />
				<asp:Parameter Name="CustomerID" Type="String" />
			</UpdateParameters>
			<DeleteParameters>
				<asp:Parameter Name="CustomerID" Type="String" />
			</DeleteParameters>
			<InsertParameters>
				<asp:Parameter Name="CustomerID" Type="String" />
				<asp:Parameter Name="CompanyName" Type="String" />
				<asp:Parameter Name="ContactName" Type="String" />
				<asp:Parameter Name="ContactTitle" Type="String" />
				<asp:Parameter Name="Address" Type="String" />
				<asp:Parameter Name="City" Type="String" />
				<asp:Parameter Name="Region" Type="String" />
				<asp:Parameter Name="PostalCode" Type="String" />
				<asp:Parameter Name="Country" Type="String" />
				<asp:Parameter Name="Phone" Type="String" />
				<asp:Parameter Name="Fax" Type="String" />
			</InsertParameters>
		</asp:SqlDataSource>
		
		<asp:SqlDataSource ID="SessionDataSource2" runat="server"
	
			ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
			
			SelectCommand="SELECT * FROM [Customers]" >
		</asp:SqlDataSource>
	</form>
</body>
</html>
