This is a migrated thread and some comments may be shown as answers.
Rad Grid
0 Answers 7 Views
This is a migrated thread and some comments may be shown as answers.
Mayur
Top achievements
Rank 1
Mayur asked on 29 Sep 2017, 07:32 AM

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

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Mayur
Top achievements
Rank 1
Share this question
or