<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%@ Import Namespace="Telerik.Web.Mvc.UI" %>

<!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>Mixing ASP.NET MVC with WebForms</title>
    
    <style type="text/css">
        body { font: 12px Tahoma, sans-serif; }
    </style>
    
    <link href="Content/2009.3.1210.0/telerik.common.min.css" rel="stylesheet" type="text/css" />
    <link href="Content/2009.3.1210.0/telerik.black.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="myLovelyForm" runat="server">
		<asp:ScriptManager runat="server" ID="ScriptManager1" />
        
		<div style="width: 45%; float: left; margin-right: 4%;">
            <h2>Telerik Extensions for ASP.NET MVC</h2>
            
            <%= Html.Telerik().Menu()
                    .Name("MyLovelyMenu")
                    .Items(items => {
                        items.Add().Text("File").Url("http://www.telerik.com/");
                        items.Add().Text("Edit");
                        items.Add().Text("Insert");
                        items.Add().Text("Format")
                            .Items(format => {
                                format.Add().Text("Font");
                                format.Add().Text("Paragraph...");
                                format.Add().Text("Bullets and Numbering...");
                                format.Add().Text("Borders and Shading...");
                                format.Add().Text("Columns");
                                format.Add().Text("Tabs");
                                format.Add().Text("Change Case");
                                format.Add().Text("Theme");
                                format.Add().Text("Frames");
                                format.Add().Text("Autoformat");
                            });
                        items.Add().Text("Tools");
                    })
                %>
                
            <%= Html.Telerik().Grid(GenerateData())
                    .Name("MyLovelyGrid")
                    .Columns(columns => {
                        columns.Add(c => c[0]).Title("ID");
                        columns.Add(c => c[1]).Title("Column 1");
                    })
                    .Pageable() 
            %>
        </div>
		
		<div style="width: 45%; float: left;">
		    <h2>Telerik RadControls for ASP.NET AJAX</h2>
    	
            <telerik:RadMenu ID="RadMenu1" runat="server" style="width: 100%; float: none;">
                <Items>
                    <telerik:RadMenuItem Text="File" NavigateUrl="http://www.telerik.com/" />
                    <telerik:RadMenuItem Text="Edit" />
                    <telerik:RadMenuItem Text="Insert" />
                    <telerik:RadMenuItem Text="Format" AccessKey="O">
                        <Items>
                            <telerik:RadMenuItem Text="Font" />
                            <telerik:RadMenuItem Text="Paragraph..." AccessKey="P" />
                            <telerik:RadMenuItem Text="Bullets and Numbering..." AccessKey="N" />
                            <telerik:RadMenuItem Text="Borders and Shading..." AccessKey="B" />
                            <telerik:RadMenuItem IsSeparator="true" />
                            <telerik:RadMenuItem Text="Columns" AccessKey="C" />
                            <telerik:RadMenuItem Text="Tabs" AccessKey="T" />
                            <telerik:RadMenuItem Text="Change Case" AccessKey="E" />
                            <telerik:RadMenuItem IsSeparator="true" />
                            <telerik:RadMenuItem Text="Theme" AccessKey="H" />
                            <telerik:RadMenuItem Text="Frames" AccessKey="R" />
                            <telerik:RadMenuItem Text="Autoformat" AccessKey="A" />
                        </Items>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="Tools" />
                </Items>
            </telerik:RadMenu>
            
            <telerik:RadGrid ID="RadGrid1" runat="server"
                OnNeedDataSource="RadGrid_NeedDataSource" AllowPaging="true" PageSize="10"
                GroupingEnabled="false">
	            <MasterTableView
		            CommandItemDisplay="None"
		            DataKeyNames="PrimaryID"
		            EditMode="EditForms"
	                AutoGenerateColumns="false"
		            HierarchyDefaultExpanded="false"
		            Name="MasterTableView1"
		            TableLayout="Fixed">
		            <Columns>
			            <telerik:GridNumericColumn DataField="PrimaryID" HeaderText="ID" HeaderStyle-Width="100px" FilterControlWidth="50px" Aggregate="Avg" />
			            <telerik:GridBoundColumn DataField="StringCol1" HeaderText="Column 1" Aggregate="CountDistinct" />
		            </Columns>
		            <SortExpressions>
			            <telerik:GridSortExpression FieldName="PrimaryID" SortOrder="Ascending" />
		            </SortExpressions>
		            <GroupByExpressions>
			            <telerik:GridGroupByExpression>
				            <GroupByFields>
					            <telerik:GridGroupByField FieldName="GroupID" />
				            </GroupByFields>
				            <SelectFields>
					            <telerik:GridGroupByField FieldName="GroupID" />
				            </SelectFields>
			            </telerik:GridGroupByExpression>
		            </GroupByExpressions>
	            </MasterTableView>
            </telerik:RadGrid>
        </div>
    </form>

    <% Html.Telerik().ScriptRegistrar().Render(); %>
</body>
</html>
