This is a migrated thread and some comments may be shown as answers.

[Solved] Urgent: radgrid need twice submit to rebind

2 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrea Gorin
Top achievements
Rank 2
Andrea Gorin asked on 15 Dec 2009, 11:47 AM
protected void btnApplicaFiltro_Click(object sender, EventArgs e)

I have a radgrid within a MS Update Panel.

When I submit with command:

protected void btnApplicaFiltro_Click(object sender, EventArgs e)
{
gridOrdini_DataBind();
}

protected void gridOrdini_DataBind()

    gridOrdini.Rebind();
}

The first time the grid not update data.

My grid:

<telerik:radgrid id="gridOrdini" runat="server" allowpaging="True" allowsorting="True"
datasourceid="sdsOrdini" gridlines="None" onitemcommand="RadGrid1_ItemCommand">
<MasterTableView AutoGenerateColumns="False" DataSourceID="sdsOrdini">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="td_anno" HeaderText="td_anno" SortExpression="td_anno"
UniqueName="td_anno" DataType="System.Int16">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="td_serie" HeaderText="td_serie" SortExpression="td_serie"
UniqueName="td_serie">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="td_numord" HeaderText="td_numord" SortExpression="td_numord"
UniqueName="td_numord" DataType="System.Int32">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="td_datord" DataType="System.DateTime" HeaderText="td_datord"
SortExpression="td_datord" UniqueName="td_datord">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="td_riferim" HeaderText="td_riferim" SortExpression="td_riferim"
UniqueName="td_riferim">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="td_flevas" HeaderText="td_flevas" SortExpression="td_flevas"
UniqueName="td_flevas">
</telerik:GridBoundColumn>
</Columns>
<DetailTables>
<telerik:GridTableView AutoGenerateColumns="false" Caption="Sales per Employee" AllowSorting="false"
DataSourceID="sdsDettaglioOrdini" Width="100%" PageSize="5">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="codditt, td_tipork, td_anno, td_serie, td_numord"
MasterKeyField="codditt, td_tipork, td_anno, td_serie, td_numord" />
</ParentTableRelation>
<Columns>
<telerik:GridBoundColumn SortExpression="mo_riga" HeaderText="N." HeaderButtonType="TextButton"
DataField="mo_riga" Resizable="True" Reorderable="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="mo_codart" HeaderText="Cod. art." HeaderButtonType="TextButton"
DataField="mo_codart" Resizable="True" Reorderable="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="ar_descr" HeaderText="Descr." HeaderButtonType="TextButton"
DataField="ar_descr" Resizable="True" Reorderable="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="mo_unmis" HeaderText="U.m." HeaderButtonType="TextButton"
DataField="mo_unmis" Resizable="True" Reorderable="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="mo_quant" HeaderText="Q.tà ord." HeaderButtonType="TextButton"
DataField="mo_quant" Resizable="True" Reorderable="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="mo_quaeva" HeaderText="Q.tà evasa" HeaderButtonType="TextButton"
DataField="mo_quaeva" Resizable="True" Reorderable="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="mo_quapre" HeaderText="Q.tà pren." HeaderButtonType="TextButton"
DataField="mo_quapre" Resizable="True" Reorderable="True">
</telerik:GridBoundColumn>
</Columns>
</telerik:GridTableView>
</DetailTables>
</MasterTableView>
</telerik:radgrid>

Any idea ?

Thanks, Andrea

2 Answers, 1 is accepted

Sort by
0
Johny
Top achievements
Rank 1
answered on 16 Dec 2009, 08:35 AM
Hi Andrea,

Are you sure that the button performing the postback is also located in the Update panel?
I have also noticed that you set the GridRelationFields in a way that I don't think is supported. Check the paragraph that is above the last code snippet in this link:

http://www.telerik.com/help/aspnet-ajax/grdhierarchicaldatabindingusingneeddatasource.html

I hope this helps.
Johny
0
Andrea Gorin
Top achievements
Rank 2
answered on 18 Dec 2009, 03:21 PM
Ok, resolved !
Tags
Grid
Asked by
Andrea Gorin
Top achievements
Rank 2
Answers by
Johny
Top achievements
Rank 1
Andrea Gorin
Top achievements
Rank 2
Share this question
or