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

Show NestedViewTemplate on Edit command

1 Answer 17 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 19 Jul 2019, 05:03 PM

Hello,

I need to show the NestedViewTemplate for a row when that row is edited using in-place editing. How can I achieve this? So far what I have tried was calling the expand event on the Edit command like so:

if(e.CommandName == RadGrid.EditCommandName)
       {
           e.Item.FireCommandEvent(RadGrid.ExpandCollapseCommandName, new GridExpandCommandEventArgs(e.Item, sender, e));
           //e.Item.Expanded = true;
       }

 

The RadGrid.ExpandCollapse command is correctly being fired but the in-place editing is showing and the NestedViewTemplate is not showing as intended.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 24 Jul 2019, 11:10 AM
Hi Ryan,

You can achieve this requirement using the following approach:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    foreach (GridEditableItem item in RadGrid1.Items)
    {
        if (item.IsInEditMode)
        {
            item.Expanded = true;
        }
    }
}

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or