Feb 09, 2009, 7:44 PM
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:
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>