PDA

View Full Version : [CLOSED] Junk Values while refreshing gridpanel



Tonic
Jan 30, 2013, 5:47 AM
Hi there

I have Created a grid-panel, on the first time it works fine but when ever the page is refreshed it throws up some junk value like

"<#:item selector="fixTitle"> <#:item selector="removeLeadingEmptyLines" /><#:item selector="removeLeadingEmptyLinesAfterForm" />"


Below is my code


In .ASPX


<ext:GridPanel ID="gpCalEngine" runat="server" Title="Calulation Sheet" Layout="TableLayout" RowLines="true" ColumnLines="true" Icon="Calculator">
<Store>
<ext:Store ID="StrCalEngine" runat="server" PageSize="20">
<Model>
<ext:Model ID="mdlCalEngine" runat="server">
<Fields>
<ext:ModelField Name="sno">
</ext:ModelField>
<ext:ModelField Name="rowlabel">
</ext:ModelField>
<ext:ModelField Name="Funcdescription">
</ext:ModelField>
<ext:ModelField Name="Funcvaluen">
</ext:ModelField>
<ext:ModelField Name="Funcvaluet">
</ext:ModelField>
<ext:ModelField Name="Funcvaluel">
</ext:ModelField>
<ext:ModelField Name="Formula">
</ext:ModelField>
<ext:ModelField Name="Resulttype">
</ext:ModelField>
<ext:ModelField Name="CalculateIf">
</ext:ModelField>
<ext:ModelField Name="savecode">
</ext:ModelField>
<ext:ModelField Name="Remarks">
</ext:ModelField>
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<TopBar>
<ext:Toolbar runat="server" ID="tbMain">
<Items>
<ext:Button ID="btn1" runat="server" Icon="CalculatorLink" Text="Calculate">
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<ColumnModel>
<Columns>
<ext:Column ID="Sno" runat="server" Text="S.No" DataIndex="sno">
</ext:Column>
<ext:Column ID="rowLabel" runat="server" Text="Row Label" DataIndex="rowlabel" >
<Editor>
<ext:TextField ID="txtRowLabel" runat="server">
</ext:TextField>
</Editor>
</ext:Column>
<ext:Column ID="Description" runat="server" Text="Description" DataIndex="Funcdescription">
<Editor>
<ext:TextArea ID="txtareaDesc" runat="server">
</ext:TextArea>
</Editor>
</ext:Column>
<ext:Column ID="valueN" runat="server" Text="Value(N)" DataIndex="Funcvaluen">
<Editor>
<ext:TextField ID="txtValueN" runat="server">
</ext:TextField>
</Editor>
</ext:Column>
<ext:Column ID="valueT" runat="server" Text="Value(T)" DataIndex="Funcvaluet">
<Editor>
<ext:TextField ID="txtValueT" runat="server">
</ext:TextField>
</Editor>
</ext:Column>
<ext:Column ID="valueL" runat="server" Text="Value(L)" DataIndex="Funcvaluel">
<Editor>
<ext:TextField ID="txtVaueN" runat="server">
</ext:TextField>
</Editor>
</ext:Column>
<ext:Column ID="Formula" runat="server" Text="Formula" DataIndex="Formula">
<Editor>
<ext:TextArea ID="txtFormula" Height="150" Width="150" runat="server">
</ext:TextArea>
</Editor>
</ext:Column>
<ext:Column ID="ResultType" runat="server" Text="Result Type" DataIndex="Resulttype" >
<Editor>
<ext:TextField ID="txtResultType" runat="server">
</ext:TextField>
</Editor>
</ext:Column>
<ext:Column ID="CalculateIf" runat="server" Text="Calculate If" DataIndex="CalculateIf">
<Editor>
<ext:TextArea ID="txtCalculateif" runat="server">
</ext:TextArea>
</Editor>
</ext:Column>
<ext:Column ID="SaveCode" runat="server" Text="Save Code" DataIndex="savecode">
<Editor>
<ext:TextField ID="txtSaveCode" runat="server">
</ext:TextField>
</Editor>
</ext:Column>
<ext:Column ID="Remarks" runat="server" Text="Remarks" DataIndex="Remarks">
<Editor>
<ext:TextArea ID="txtRemarks" runat="server">
</ext:TextArea>
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<Plugins>
<ext:CellEditing ID="CellEditing1" runat="server" />
</Plugins>
</ext:GridPanel>


in .ASPX.CS am calling a function called bindgrid() on page Load



private void BindGrid()
{
DataTable dt = new DataTable();
dt.Columns.Add("sno");
dt.Columns.Add("rowlabel");
dt.Columns.Add("Funcdescription");
dt.Columns.Add("Funcvaluen");
dt.Columns.Add("Funcvaluet");
dt.Columns.Add("Funcvaluel");
dt.Columns.Add("Formula");
dt.Columns.Add("Resulttype");
dt.Columns.Add("CalculateIf");
dt.Columns.Add("savecode");
dt.Columns.Add("Remarks");
for (int i = 0; i < 20; i++)
{
dt.Rows.Add(i + 1, "", "", "", "", "", "", "", "", "", "");
}
/////Binding strore for gridpanel
StrCalEngine.DataSource = dt;
StrCalEngine.DataBind();

}



Thnxx in advace

Daniil
Jan 30, 2013, 8:07 AM
Hi @Tonic,

How do you refresh the GridPanel?"

Wheredo you see this?
<#:item selector="fixTitle"> <#:item selector="removeLeadingEmptyLines" /><#:item selector="removeLeadingEmptyLinesAfterForm" />"

Tonic
Jan 30, 2013, 8:48 AM
Hi @Tonic,

How do you refresh the GridPanel?"

Wheredo you see this?
<#:item selector="fixTitle"> <#:item selector="removeLeadingEmptyLines" /><#:item selector="removeLeadingEmptyLinesAfterForm" />"

I don't refresh the GridPanel, it happens when a post-back take place on click of a button on page

the error msg is show my aspx page at runtime in place of the GridPanel, See below screen shots

5506

and when i click on a button this happens

5507

Daniil
Jan 30, 2013, 1:05 PM
I guess some actions in Page_Load and/or Page_Init should be not executed during a PostBack.

Maybe,

store.DataBind();

I can't see in your code snippet any button which could cause a PostBack.

If the issue persists, please provide a full sample to reproduce.