detailtable insert

2 posts, 0 answers
  1. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 03 Apr 2009 Link to this post

    I have a grid with a master and detail table.  When inserting data into the detail table, I need to get a value from one of the cells in the selected row of the parent table but it isnt a datakey value.  How can I do this ?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Apr 2009 Link to this post

    Hello Mark,

    A suggestion is to check for the DetailTable name and the command name in the ItemCommand event of the grid and get the selected items collection of the grid as shown below:
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
           if (e.Item.OwnerTableView.Name == "Detail" && e.CommandName == RadGrid.PerformInsertCommandName) 
                  foreach (GridDataItem dataItem in RadGrid1.SelectedItems) 
                        string strtxt = dataItem["ColumnUniqueName"].Text; 

Back to Top