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

detailtable insert

1 Answer 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 03 Apr 2009, 02:04 PM
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 ?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Apr 2009, 05:28 AM
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:
C#:
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; 
                } 
        } 
    } 
 

Thanks
Princy.
Tags
Grid
Asked by
mww
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or