Hi,

In page load dynamic gridpanel with dynamic store is working perfect.when i select combobox and call the grid panel,data is not binding in gridpanel.
Please help me....





<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="offer.aspx.cs" Inherits="" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!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></title>
   
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
      <ext:Store runat="server" ID="StoreRole">          
            <Reader>
                <ext:JsonReader IDProperty="Value">
                    <Fields>
                        <ext:RecordField Name="Text" />
                        <ext:RecordField Name="Value" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
           <ext:Window 
            ID="WindowSteward" 
            runat="server"
            Resizable="false"
            Height="200" 
            Icon="Add"
            Title="New Role"
            Draggable="false"
            Width="650"
            Modal="true"
            Padding="5"
            
           
            Layout="Form">
            <Items>
           <ext:ComboBox ID="cmbRole" runat="server" StoreID="StoreRole" 
            Editable="false"
            FieldLabel="Role"
            DisplayField="Text"
            ValueField="Value"
            TypeAhead="true" 
            Mode="Local"
            width="300"
            ForceSelection="true"
            EmptyText="Select Role..."
            Resizable="true"
            SelectOnFocus="true" IndicatorText="*"   IndicatorCls="red-text"  > 
            <DirectEvents><Select OnEvent="SelectClick"></Select></DirectEvents>
            
            
            </ext:ComboBox>
     
     <ext:Panel runat="server" ID="Panel1" Width="504" Height="450" >   
    </ext:Panel>
    </Items>
    </ext:Window> 
    
    </form>
</body>
</html>


public class Vani
    {
        public Vani(string a, string b)
        {
            this.VALUE = a;
            this.VALUE2 = b;
        }

        public string VALUE
        {
            get;
            set;
        }

        public string VALUE2
        {
            get;
            set;
        }
    }
    
    public partial class offer : System.Web.UI.Page
    {

        private void FillRole()
        {

            if (!X.IsAjaxRequest)
            {
                List<object> list = new List<object>
            {
                new {Text = "Text3", Value = 3},
                new {Text = "Text4", Value = 4},
                new {Text = "Text5", Value = 5}
            };

                this.StoreRole.DataSource = list;
                this.StoreRole.DataBind();
            }
           
        }
        protected void SelectClick(object sender, DirectEventArgs e)
        {
            if (cmbRole.SelectedIndex > 0)
            {
                FillPanel();
            }
        }
        
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!X.IsAjaxRequest)
            {
                FillRole();
                
            }

        }


        private void FillPanel()
        {
            FormLayout schemaFL = new FormLayout();
            Anchor a = new Anchor();
            a.Horizontal = "95%";

            JsonReader ar = new JsonReader();
            RecordField rf = new RecordField("VALUE", RecordFieldType.String);
            RecordField rf2 = new RecordField("VALUE2", RecordFieldType.String);
            ar.Fields.Add(rf);
            ar.Fields.Add(rf2);

            Store myStore = new Store();
            myStore.ID = "Store1";
            myStore.Reader.Add(ar);
            myStore.DataSource = new List<Vani>
             {
            new Vani("1", "1"),
            new Vani("2", "2")
             };
            this.form1.Controls.AddAt(0, myStore);
            myStore.DataBind();

            GridPanel grid = new GridPanel();
            grid.ID = "myGrid";
            grid.Width = Unit.Pixel(300);
            grid.Height = Unit.Pixel(300);
            grid.StoreID = "Store1";
            Ext.Net.Column col = new Ext.Net.Column();
            col.ColumnID = "colID";
            col.Header = "Column1";
            col.DataIndex = "VALUE";
            col.Sortable = true;

            Ext.Net.Column col2 = new Ext.Net.Column();
            col2.ColumnID = "colID2";
            col2.Header = "Column2";
            col2.DataIndex = "VALUE2";
            col2.Sortable = true;

            grid.ColumnModel.Columns.Add(col);
            grid.ColumnModel.Columns.Add(col2);

            a.Items.Add(grid);
            schemaFL.Anchors.Add(a);
            Panel1.Items.Add(schemaFL);
           
        }
    
    
    
    }
}