1. Mayur
    Mayur avatar
    1 posts
    Member since:
    Aug 2016

    Posted 29 Sep 2017 Link to this post

    I attached a image for that. In which when i click on Add Filter icon I add a new row inside nested grid. But it get add on every nested Grid.

    I want it to be add for a particular row of parent grid not for every parent row only for a row in which Add Filter is get clicked.

    grdTruckerSlot_ItemCommand: parent grid 

    grdSlotFilterAllocation : nested grid(child)

    StoretruckingFilterSlots: view state

     

    public DataTable StoretruckingFilterSlots        {            get { return ViewState["StoretruckingFilterSlots"] != null ? (DataTable)ViewState["StoretruckingFilterSlots"] : new DataTable(); }            set { ViewState["StoretruckingFilterSlots"] = value; }        }

     

    protected void grdTruckerSlot_ItemCommand(object source, GridCommandEventArgs e)
           {
            case "AddFilter":
                                
                                   DataRow drnew = StoretruckingFilterSlots.NewRow();
                                   StoretruckingFilterSlots.Rows.Add(drnew);
     
                                   GridDataItem dataItem = e.Item as GridDataItem;
                                   GridNestedViewItem nestedItem = (GridNestedViewItem)dataItem.ChildItem;
                                                                 
                                       RadGrid grdSlotFilterAllocation = (RadGrid)nestedItem.FindControl("grdSlotFilterAllocation");
                                   grdSlotFilterAllocation.DataSource = StoretruckingFilterSlots;
                                   grdSlotFilterAllocation.Rebind();
           }

    Please help me in this.

    Thanks

    Mayur

Back to Top