Aug 08, 2011, 10:18 AM
k Daniil, Im preparing and posting it soon as im back home (wtihin 5/6 hours). Thanks a lot.
.page
{
width: 960px;
background-color: #fff;
margin: 20px auto 0px auto;
border: 1px solid #496077;
}
MasterPage -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="TestExtApp.SiteMaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form runat="server">
<div class="page">
<div class="header">
</div>
<div class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
<div class="clear">
</div>
</div>
<div class="footer">
</div>
</form>
</body>
</html>
Test Page -<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="GridTest.aspx.cs" Inherits="TestExtApp.GridTest" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
#region Event Handlers and Listeners
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
BindGridCountry();
}
}
#endregion
#region Private Methods
/// <summary>
/// Private method to bind grid data
/// </summary>
private void BindGridCountry()
{
var store = this.grdCountry.GetStore();
store.DataSource = LoadGridData();
store.DataBind();
}
private IList<Object> LoadGridData()
{
return new List<object>
{
new {
CountryCode = "AA",
CountryName = "Country A",
CountryCode_BN = "AA bn",
CountryName_BN = "Country A bn",
},
new {
CountryCode = "AA",
CountryName = "Country A",
CountryCode_BN = "AA bn",
CountryName_BN = "Country A bn",
},
new {
CountryCode = "AA",
CountryName = "Country A",
CountryCode_BN = "AA bn",
CountryName_BN = "Country A bn",
},
new {
CountryCode = "AA",
CountryName = "Country A",
CountryCode_BN = "AA bn",
CountryName_BN = "Country A bn",
},
new {
CountryCode = "AA",
CountryName = "Country A",
CountryCode_BN = "AA bn",
CountryName_BN = "Country A bn",
},
new {
CountryCode = "AA",
CountryName = "Country A",
CountryCode_BN = "AA bn",
CountryName_BN = "Country A bn",
},
new {
CountryCode = "AA",
CountryName = "Country A",
CountryCode_BN = "AA bn",
CountryName_BN = "Country A bn",
},
new {
CountryCode = "AA",
CountryName = "Country A",
CountryCode_BN = "AA bn",
CountryName_BN = "Country A bn",
},
new {
CountryCode = "AA",
CountryName = "Country A",
CountryCode_BN = "AA bn",
CountryName_BN = "Country A bn",
},
new {
CountryCode = "BB",
CountryName = "Country B",
CountryCode_BN = "BB bn",
CountryName_BN = "Country B bn",
}
};
}
#endregion
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server"/>
<ext:Window ID="wndCountryEntry" runat="server" Title="Add New Country" Icon="BulletAdd"
Modal="True" Hidden="True" Draggable="False" AutoHeight="True" MinWidth="500px"
MinHeight="200px" Plain="True" Padding="5" ButtonAlign="Center" LabelWidth="55"
Layout="Form" Height="200px" Width="500px">
<buttons>
<ext:Button runat="server" Text="Save" Icon="Disk" />
<ext:Button runat="server" Text="Cancel" Icon="Decline" >
<Listeners>
<Click Handler="#{wndCountryEntry}.hide();" />
</Listeners>
</ext:Button>
</buttons>
<LoadMask ShowMask="True" />
<Items>
<ext:Panel ID="pnlCountryEntryEN" runat="server" Title="Country Entry (English)"
AutoWidth="True" Layout="Form" AutoHeight="True" AnchorHorizontal="100%" Padding="5">
<Items>
<ext:TextField ID="txtCountryCodeEN" runat="server" FieldLabel="Country Code " AnchorHorizontal="50%"/>
<ext:TextField ID="txtCountryNameEN" runat="server" FieldLabel="Country Name " AnchorHorizontal="100%"/>
</Items>
</ext:Panel>
<ext:Panel ID="pnlCountryEntryBN" runat="server" Title="Country Entry (Bangla)" AutoWidth="True"
Layout="Form" AutoHeight="True" AnchorHorizontal="100%" Padding="5">
<Items>
<ext:TextField ID="txtCountryCodeBN" runat="server" FieldLabel="Country Code " AnchorHorizontal="50%"/>
<ext:TextField ID="txtCountryNameBN" runat="server" FieldLabel="Country Name " AnchorHorizontal="100%"/>
</Items>
</ext:Panel>
</Items>
</ext:Window>
<ext:Panel ID="pnlCountry" runat="server" Title="Country Info" Height="600px" Layout="BorderLayout"
Header="False" DefaultPadding="5" DefaultCollapsible="false" DefaultSplit="true">
<Items>
<ext:GridPanel ID="grdCountry" runat="server" AnchorHorizontal="100%" Height="400px"
Title="Country Info" Region="Center">
<loadmask showmask="True" />
<savemask showmask="True" />
<Store>
<ext:Store ID="storeGrdCountry" runat="server" AutoSave="true" SerializationMode="Simple">
<Reader>
<ext:JsonReader IDProperty="OID">
<Fields>
<ext:RecordField Name="CountryCode" Mapping="CountryCode" Type="String" />
<ext:RecordField Name="CountryName" Mapping="CountryName" Type="String" />
<ext:RecordField Name="CountryCode_BN" Mapping="CountryCode_BN" Type="String" />
<ext:RecordField Name="CountryName_BN" Mapping="CountryName_BN" Type="String" />
<ext:RecordField Name="CreatedBy" Mapping="CreatedBy" />
<ext:RecordField Name="CreatedDate" Mapping="CreatedDate" Type="Date" DateFormat="yyyy-MM-ddThh:mm:ss" />
<ext:RecordField Name="ModifiedBy" Mapping="ModifiedBy" />
<ext:RecordField Name="ModifiedDate" Mapping="ModifiedDate" Type="Date" DateFormat="yyyy-MM-ddThh:mm:ss" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<View>
<ext:GridView ID="GridView1" runat="server" MarkDirty="False"/>
</View>
<columnmodel>
<Columns>
<ext:RowNumbererColumn />
<ext:Column ColumnID="CountryCode" Header="Country Code (English)"
DataIndex="CountryCode" Width="135px">
<Editor>
<ext:TextField runat="server" AllowBlank="true"/>
</Editor>
</ext:Column>
<ext:Column Header="Name (English)" DataIndex="CountryName"
Width="250px" >
<Editor>
<ext:TextField runat="server" AllowBlank="true"/>
</Editor>
</ext:Column>
<ext:Column Header="Country Code (Bengali)" DataIndex="CountryCode_BN" Width="135px">
<Editor>
<ext:TextField runat="server" AllowBlank="true"/>
</Editor>
</ext:Column>
<ext:Column Header="Name (Bengali)" DataIndex="CountryName_BN"
Width="250px" >
<Editor>
<ext:TextField runat="server" AllowBlank="true"/>
</Editor>
</ext:Column>
</Columns>
</columnmodel>
<DirectEvents>
</DirectEvents>
<bottombar>
<ext:PagingToolbar runat="server" PageSize="10"
DisplayInfo="True"/>
</bottombar>
<topbar>
<ext:Toolbar runat="server" >
<Items>
<ext:Button runat="server" Text="Add New Country" Icon="Add" >
<Listeners>
<Click Handler="#{wndCountryEntry}.show();"></Click>
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</topbar>
<plugins>
<ext:RowEditor runat="server" SaveText="Update" Floating="true"/>
</plugins>
</ext:GridPanel>
</Items>
</ext:Panel>
</asp:Content>