Here you go
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication4.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Simple Array Grid</title>
</head>
<body>
<ext:ResourceManager runat="server" Theme="Gray" />
<h1>Simple Array Grid</h1>
<ext:GridPanel
ID="GridPanel1"
runat="server"
Title="Array Grid"
AutoHeight="True" AutoWidth="True">
<Store>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:JsonReader IDProperty="Key">
<Fields>
<ext:RecordField Name="Key" />
<ext:RecordField Name="Value" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column ColumnID="Key" Header="Key" DataIndex="Key" />
<ext:Column Header="Value" DataIndex="Value"/>
</Columns>
</ColumnModel>
</ext:GridPanel>
</body>
</html>
code behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
namespace WebApplication4
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = this.Data;
this.Store1.DataBind();
}
}
private List<PropertyItem> Data
{
get
{
// this data does not work
List<PropertyItem> items = new List<PropertyItem>();
items.Add(new PropertyItem() { Key = "key1", Value = "${fileName}" });
items.Add(new PropertyItem() { Key = "key2", Value = "value2" });
items.Add(new PropertyItem() { Key = "key3", Value = "#{fileName}" });
return items;
}
}
private List<PropertyItem> DataWorks
{
get
{
// this data does
List<PropertyItem> items = new List<PropertyItem>();
items.Add(new PropertyItem() { Key = "key1", Value = "filename" });
items.Add(new PropertyItem() { Key = "key2", Value = "value2" });
items.Add(new PropertyItem() { Key = "key3", Value = "filename2" });
return items;
}
}
}
public class PropertyItem
{
#region Properties
public string Key { get; set; }
public string Value {get; set;}
#endregion
}
}