Adding column Header text in code-behind page prevents rows from loading in GridPanel

  1. #1

    Adding column Header text in code-behind page prevents rows from loading in GridPanel

    Hi,

    I moved this issue in the BUGS section thinking that this could be a possible bug...

    ************************************************** ****************************

    I have a page where I am doing these things in the code behind page load:

    1) Adding ArrayReader fields for Store
    2) Adding Columns to Grid
    3) Create DataSource (Array) and bind to Store

    All
    works just fine as long as I don't set the Column header text when I am
    adding the columns to the grid. If I do set the header text, I get
    nothing in the grid. Just uncomment the 2 lines of code.

    Any help would be greatly appreciated as to why this is happening. Maybe I am not doing something correctly.

    Here's simplified code to help demonstrate what I am seeing:

    Code Behind:
            protected void Page_Load(object sender, EventArgs e)
            {
                ArrayReader tempReader = new ArrayReader();
    
                Column newCol = new Column();
                newCol.DataIndex = "name";
                //newCol.Header = "test1";
                GridPanel1.ColumnModel.Columns.Add(newCol);
    
                newCol = new Column();
                newCol.DataIndex = "value";
                //newCol.Header = "test2";
                GridPanel1.ColumnModel.Columns.Add(newCol);
    
                
                RecordField tempField = new RecordField("name");
                tempReader.Fields.Add(tempField);
                tempField = new RecordField("value");
                tempReader.Fields.Add(tempField);
                Store1.Reader.Add(tempReader);
    
                this.Store1.DataSource = new object[]
                {
                    new object[] {"Age Determination", "Age Nearest"},
                    new object[] {"Allow Reentry", "End of 10th Year"},
                    new object[] {"Years Level", "10"},
                    new object[] {"Years Guaranteed", "10"},
                    new object[] {"Modal Policy Fee", "$85"},
                    new object[] {"Min/Max Face Amount", "$100,000/$25,000,000"},
                    new object[] {"Min/Max Premium", "$25/$25,000"},
                    new object[] {"Conversion Option", "End of 10th Year"},
                    new object[] {"Policy Maturity Age", "99"},
                    new object[] {"Min/Max Issue Age", "18/69"},
                    new object[] {"Semi-Annual Rate", ".52"},
                    new object[] {"Quarterly Rate", ".27"},
                    new object[] {"Monthly Bank Draft Rate", ".089"},
                    new object[] {"Rate Card Id", "Version 4/1/06"},
                    new object[] {"Software Version", "2.81"},
                    new object[] {"Policy Form Number", "92-SR71"}
                };
    
                this.Store1.DataBind();
            }
    HTML inside the body tag:
       <ext:ScriptManager ID="ScriptManager1" runat="server" />  
       <ext:Store ID="Store1" runat="server" IgnoreExtraFields="true" />
        
       <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" TrackMouseOver="false"
        Title="Quote Results" Collapsible="true" AnimCollapse="true" 
        Icon="Table" Width="778" AutoWidth="true">
    
           <ColumnModel ID="ColumnModel1" runat="server"></ColumnModel>
            
           <View>
               <ext:GridView ID="GridView1" runat="server" ForceFit="true" />
           </View>
           <SelectionModel>
               <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
           </SelectionModel>
           <Buttons>
               <ext:Button ID="Button17" runat="server" Text="Back" Icon="PreviousGreen"></ext:Button>
               <ext:Button ID="Button4" runat="server" Text="Next" Icon="NextBlue" ></ext:Button>
           </Buttons>                               
        
           <LoadMask ShowMask="true" />
    
    </ext:GridPanel>
  2. #2

    RE: Adding column Header text in code-behind page prevents rows from loading in GridPanel

    Hi,

    Set fixed Height for GridPanel or set AutoHeight="true"*


Similar Threads

  1. Replies: 2
    Last Post: Jun 01, 2011, 8:12 AM
  2. Replies: 3
    Last Post: Sep 09, 2010, 6:31 AM
  3. Replies: 0
    Last Post: Feb 17, 2010, 5:38 AM
  4. Replies: 9
    Last Post: Apr 27, 2009, 3:19 PM
  5. Replies: 2
    Last Post: Feb 10, 2009, 7:45 PM

Posting Permissions