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

RadGrid with Inform Edit and Inform Detail

4 Answers 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris Breymeyer
Top achievements
Rank 1
Chris Breymeyer asked on 12 Aug 2008, 09:37 PM
Hello all,

I am trying to work with the RadGrid control to have both edit and detail views.  The feel I am looking for is like the following example:

http://www.telerik.com/demos/aspnet/Grid/Examples/Programming/WebGrid/DefaultCS.aspx

which includes and in-form edit view.  I have modified this example successfully to work with my data, and am starting to understand it.  What I'd like to do is to also have a "detail" link for each record and display a similar in-form view but with read only labels.

I hope I am clear in what I am trying to accomplish.  Could someone please help push me in the right direction?

Thanks,
John Reynolds

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 Aug 2008, 07:30 AM
Hello John,

You can achieve the required scenario using the NestedViewTemplate.Refer to the below given link which demonstrates how to  set a NestedViewTemplate within the Grid.
NestedViewTemplate

Thanks
Princy.
0
Chris Breymeyer
Top achievements
Rank 1
answered on 14 Aug 2008, 03:14 PM
Thank you for your response.  Looking at the sample, it is not clear to me how you can use a detail template AND an edit form in the same grid.
0
Chris Breymeyer
Top achievements
Rank 1
answered on 14 Aug 2008, 03:52 PM
Ok, I figured out how to have both the nested template and the edit form on the same grid.  However, I now have another related issue.

How do I make sure only one is visible at a time?  Currently if I click the edit link, the edit form shows up, but if I then click the little plus sign to expand the detail, the edit form is still visible.  I would like only one of the to show at a time.

Any ideas?

thanks,

John
0
Princy
Top achievements
Rank 2
answered on 18 Aug 2008, 06:52 AM
Hi John,

You can try the following code snippet to clear the edit forms in a Grid on clicking the expand/collapse button.

CS:
 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == "ExpandCollapse") 
        { 
            RadGrid1.MasterTableView.ClearEditItems(); 
        } 
    } 

Regards
Princy.
Tags
Grid
Asked by
Chris Breymeyer
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Chris Breymeyer
Top achievements
Rank 1
Share this question
or