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

[Solved] Inline Edit of the Detail Records - find new values

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
chitraang
Top achievements
Rank 1
chitraang asked on 17 May 2013, 04:07 PM
When the user edits the detail record inline in the Detail Table view - we want to get the new values entered by the user in the detail columns and save it to the database. We want to know how do we access the particular edited detail row and the column values from the DetailView of the master - detail grid. Any suggestions much appreciated ??

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 May 2013, 04:46 AM
Hi Chitraang,

I guess you want  to get the new values entered by the user in the detail columns in UpdateCommand event. Please set the Name Property of the GridTableView as follows.

ASPX:
<DetailTables>
    <telerik:GridTableView runat="server" Name="Detail" >
    .  .  .

The code below shows how to access the detail table values when in edit mode in inline in UpdateCommand.

C#:
protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
{
   if (e.Item is GridEditableItem && e.Item.IsInEditMode && e.Item.OwnerTableView.Name=="Detail")
   {
       GridEditableItem editItem = (GridEditableItem)e.Item;
       TextBox textbox = (TextBox)editItem["UniqueColumnName"].Controls[0]; //accessing the TextBox in DetailTable in edit mode
          // your code to update in Database
   }
}


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