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

RadGrid, UpdatePanel and ModalPopupExtender

3 Answers 424 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Russ
Top achievements
Rank 1
Russ asked on 24 Feb 2009, 09:19 PM
I am in the process of upgrading my application from ASP.NET Classic controls to the ASP.NET AJAX controls.

I have multiple places where I use a RadGrid inside an MS UpdatePanel - Using a Linkbutton (or a GridButtonColumn) on each row. The LinkButton fires the ItemCommand event back on the server, which in turn prepares some information in another UpdatePanel on the page and calls a ModalPopupExtender to show the second UpdatePanel as a modal box. Here is some psuedo code on how its set up...

... Aspx Page Structure ...

<UpdatePanel id=UpdatePanel1>
    <RadGrid id=RadGrid1 OnItemCommand="RadGrid1_ItemCommand" >
        Grid Markup
    </RadGrid>
</UpdatePanel>

<UpdatePanel id=UpdatePanel2>
    <ModalPopupExtender id=ModalPopupExtender1>        
    Page Markup
</UpdatePanel>

...code behind...

RadGrid1_ItemCommand(sender, args)
{    
    ...format controls in UpdatePanel2 ...
    
    UpdatePanel2.Update()
    ModalPopupExtender1.Show()
}

This has been working great with the Classic RadGrid - but now with the AJAX RadGrid the ModalPopupExtender1.Show() will not display the modal box. The ItemCommand is firing just fine and the code executes as before. It just wont "Show" the popup extender. I have other modal popup extenders on the page that are displayed using the codebehind .Show() method of the extender, but are just not called from within the grid and they are working fine also.

What is different about the AJAX version of RadGrid that would make this happen? Any clues on how to resolve the issue?

Thanks... Russ
    
    

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 27 Feb 2009, 03:50 PM
Hi Russ,

I think that the sample project from the following code library thread on our site can be used as basis for your custom implementation process:

http://www.telerik.com/community/code-library/aspnet-ajax/grid/display-radgrid-row-details-in-ajaxtoolkit-modalpopupextender.aspx

It illustrates how to display detail info upon clicking a link button in an arbitrary grid row. Feel free to modify/expand the solution to meet your additional requirements (if present).

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Russ
Top achievements
Rank 1
answered on 20 Mar 2009, 07:40 PM
Hi Sebastian - Thanks for your help...

I had looked at this solution previously. Unfortunately this didnt really resolve my problem since Im am trying to display the ModalPopupExtender from a server-side "ModalPopupExtender1.Show()" call instead of a client side call. - I think that is the differences in approaches here.

Anyway - The approach I was using worked fine in the classic controls but does not work in the AJAX controls. My server-side event is still being called and it's code executes. The only thing that doesnt work now is the "ModalPopupExtender.Show()" call from my server code.

Am still digging to see if I can find a solution...   Russ
0
Sebastian
Telerik team
answered on 24 Mar 2009, 11:28 AM

Hello Russ,

I reviewed your code fragment once again and noticed that you wrap the grid and the modal popup extender in individual MS UpdatePanels. Can this be related to the issue you are facing? You may consider removing the update panels and ajaxify the controls via single RadAjaxManager on the page which will automatically inject MS UpdatePanels around the updated controls at runtime to see whether this helps.

Best regards,

Sebastian

the Telerik team


Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Russ
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Russ
Top achievements
Rank 1
Share this question
or