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

Problem in hierarchical editable Radgrid

3 Answers 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gajanan
Top achievements
Rank 2
Gajanan asked on 14 Oct 2010, 06:10 AM
hi All,
i am using hierarchical radgrid in my Application It is displaying proper records in hierarchical , in that grid i allow user to update Parent And Details(child) it is updating the my Parent Records well, but my problem is with details view when i click on update it is Updating that record , but it is showing that record in Edit mode even my edit command is successfully executed. i have attached my Problem jpeg file .
and i am using the following code to do this implementation

 
protected void RadGrid_AssignPlanner_UpdateCommand(object source, GridCommandEventArgs e)
    {
       GridEditableItem editedItem = e.Item as GridEditableItem;
 
            //Update Order By OpprtunityID
            RadComboBox rcbEmployee = editedItem.FindControl("rcbEmployee") as RadComboBox;
            Label lbl_OpportunityID = editedItem.FindControl("lbl_OpportunityID") as Label;
 
            if (rcbEmployee!=null)
                if (UIHelper.IsNumeric(rcbEmployee.SelectedValue))
                    EmployeeID = int.Parse(rcbEmployee.SelectedValue);
 
            if (lbl_OpportunityID!=null)
                if (UIHelper.IsNumeric(lbl_OpportunityID.Text))
                    OpprtunityID = int.Parse(lbl_OpportunityID.Text);
 
            if(EmployeeID>0 && OpprtunityID>0)
                UpdateOrderByOpprtunityID(OpprtunityID, EmployeeID);
 
 
            //Update Order By OrderID
            RadComboBox rcbOrderEmployee = editedItem.FindControl("rcbOrderEmployee") as RadComboBox;
            Label lbl_OrderID = editedItem.FindControl("lbl_OrderID") as Label;
             
            if (rcbOrderEmployee != null)
                if (UIHelper.IsNumeric(rcbOrderEmployee.SelectedValue))
                    EmployeeID = int.Parse(rcbOrderEmployee.SelectedValue);
 
            if (lbl_OrderID != null)
                if (UIHelper.IsNumeric(lbl_OrderID.Text))
                    OrderID = int.Parse(lbl_OrderID.Text);
 
            if (EmployeeID > 0 && OrderID > 0)
                UpdateOrderByOrderID(OrderID, EmployeeID);
 
            RadGrid_AssignPlanner.Rebind();
    }

the ASPX file code is

<telerik:RadGrid  ID="RadGrid_AssignPlanner" runat="server"
                        AllowMultiRowEdit="true"
                        AllowSorting="true" AllowAutomaticUpdates="true"
                        AllowPaging="true" PageSize="30"
                        AllowMultiRowSelection="true"
                        OnNeedDataSource="RadGrid_AssignPlanner_NeedDataSource"
                        OnItemCommand="RadGrid_AssignPlanner_ItemCommand"
                        OnItemDataBound="RadGrid_AssignPlanner_OnItemDataBound"
                        OnDetailTableDataBind="RadGrid_AssignPlanner_DetailTableDataBind"
                        OnUpdateCommand="RadGrid_AssignPlanner_UpdateCommand"
                        OnItemUpdated="RadGrid_AssignPlanner_ItemUpdated">
                         
            <MasterTableView DataKeyNames="OpportunityID" EditMode="inplace">
                <Columns>My Parent table columns </Columns>

<DetailTables>
            <telerik:GridTableView DataKeyNames="OrderId"  
                    ExpandCollapseColumn-ButtonType="PushButton" EditMode="InPlace" >
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="OpportunityID"
                            MasterKeyField="OpportunityID" />
                </ParentTableRelation>
                <Columns> Child table Column </Columns>

plz tell solution

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 14 Oct 2010, 07:38 AM
Hello Gajanan,

Since you are performing the update operation in code behind(manually), set the AllowAutomaticUpdates to false to close the update form after updation .

Thanks,
Princy.
0
Gajanan
Top achievements
Rank 2
answered on 14 Oct 2010, 08:39 AM
hii,
i tried AllowAutomaticUpdates= false but it is not working still i am face same problem
0
Iana Tsolova
Telerik team
answered on 14 Oct 2010, 10:11 AM
Hi Gajanan,

What about removing this line of code as well:

RadGrid_AssignPlanner.Rebind();


Note that the Radgrid is implicitly rebound on update command as you can see from here.

All the best,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Gajanan
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 1
Gajanan
Top achievements
Rank 2
Iana Tsolova
Telerik team
Share this question
or