View Full Version : [CLOSED] simple gridpanel databind not working in v2.1

Jul 20, 2012, 1:28 PM
The following code works in v2.0 but not in v2.1. Would you please take a look?

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">

protected void Page_Load(object sender, EventArgs e)
List<object> list = new List<object>();
asCode = "abc",
asName = "cde",
asPerc = 10.1

strAssetClassOfInstrument.Data = list;



<!DOCTYPE html>


<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<ext:Panel ID="pnlHost" runat="server" Layout="HBoxLayout" FocusOnToFront="true" Border="false" >

<ext:GridPanel ID="Grid1" runat="server" Width="170" Height="155" Padding="5">
<ext:Store ID="strAssetClassOfInstrument" runat="server">
<ext:Model ID="Model4" runat="server">
<ext:ModelField Name="asCode" />
<ext:ModelField Name="asName" />
<ext:ModelField Name="asPerc" />


<ext:Column ID="Column2" runat="server" Text="Name" DataIndex="asName" Flex="1"/>
<ext:Column ID="Column3" runat="server" Text="%" DataIndex="asPerc" Width="60" />



Jul 20, 2012, 2:31 PM
It is fixed in SVN already

If you use Data then DataBind is not required (Data will be serialized as it is, with all properties)
DataBind is used for DataSource only (DataSource is serialized according store's Model)

Jul 20, 2012, 3:59 PM
Thanks it's working now!! :)

However about the DataBind() function, you still need that if you updating the Data property in DirectMethods (i.e. not within page_load function).

Jul 20, 2012, 4:53 PM
If you need to load a data during DirectEvent/DirectMethod, please use:

store.LoadData(new object[]
new { test = "new" },