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

Rebind detailtable in radgrid

1 Answer 189 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Loyal User
Top achievements
Rank 1
Loyal User asked on 17 Apr 2014, 07:17 AM
hello,
i have a radgrid with detailtables ,

detailTable has "GridEditCommandColumn"  and another "GridTemplateColumn" that contains linkbutton to remove row ,

<MasterTableView DataKeyNames="FEATURE_ID">
             <Columns>
                 <telerik:GridBoundColumn DataField="FEATURE_ID" UniqueName="FeatureID" ></telerik:GridBoundColumn>
             </Columns>
 
             <DetailTables>
                 <telerik:GridTableView ShowHeader="true" CommandItemDisplay="Top"
                     SkinID="RadGridSkin" Width="100%" runat="server" Name="Fees"
                     EditMode="InPlace">
                     <Columns>
                         <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
                        
                         <telerik:GridBoundColumn DataField="FEE_TEMPLATE_ID" UniqueName="FeeID"></telerik:GridBoundColumn>
 
                         <telerik:GridTemplateColumn UniqueName="DeleteFee">
                             <ItemTemplate>
                                 <asp:LinkButton ID="RemoveFee" runat="server" CommandName="RemoveFee" Text="RemoveFee" ImageUrl="../../../images/cancel.png" ToolTip="<%$Resources:Strings,remove  %>" />
                             </ItemTemplate>
                         </telerik:GridTemplateColumn>
                     </Columns>
 
                 </telerik:GridTableView>
             </DetailTables>
 
         </MasterTableView>

in code behind in itemCommand event : 
dataSource of radgrid is updated and Datable.acceptchanges() is called ;

how to rebind only the detailTable where changes have occurred ??



1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 17 Apr 2014, 10:13 AM
Hi,

Can you try setting  e.Item.OwnerTableView.Rebind() in the ItemCommand event. Check for your condition and if the OwnerTableView.Name is the detail table, and add this code to your page. By default any changes made will rebind the Detail table as well as the parent table,its an expected behavior.

C#:
e.Item.OwnerTableView.Rebind();

Thanks,
Princy
Tags
Grid
Asked by
Loyal User
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or