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

Ajax, Prometheus...Insanity

7 Answers 270 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 2
Steve asked on 15 Jan 2008, 03:21 AM
I have been banging my head against the wall trying to work through what seems to be a simple scenario to me, but I can't get it to work consistently.  I'm at the point now where I just need someone with a different perspective to tell me exactly what I need to do.  OK, let me explain what I'm doing:

1. One Master Page and one Content Page.  
    a. Master Page has one RadTabStrip and one ContentPlaceHolder.
    b Content Page contains one Panel.

2. Clicking a tab on the RadTabStrip dynamically loads a user control into the Panel on the Content Page.

3. The user control (let's call it MainUC) has two Panels: Panel1 - visible on initial display, contains a Prometheus RadGrid; Panel2 - used as a container for an "Edit Details" user control (let's call it DetailUC) that will be dynamically loaded when a user selects a row in the grid.

4. When user selects a row, the RadGrid.ItemCommand handler dynamically loads DetailUC into Panel2, hides Panel1 and shows Panel2.

5. When the user clicks a "Save & Close" button in DetailUC, the data is saved to the database, the button click event is handled by MainUC, and it clears DetailUC from Panel2, hides Panel2, and re-displays Panel1 while rebinding data in the RadGrid (to show the updated data).

I'd paste code that I've attempted to accomplish this but, at this point, I'd rather just have a clean slate.  I need to know how to wire up the Ajax to take care of all of the above and I just can't get it right.  I'm loading the user control in the master page with the same code posted in several threads on this site, so I know I'm doing that right.  I was also attempting to use RadAjaxManager in the master and RadAjaxManagerProxy in my MainUC, like I saw in several posts and Telerik help files.  Nothing seems to work consistently...I fix one thing, another breaks.

Can anyone help?!  I need to get this figured out quickly so I can move on developing my site.  Thanks in advance.

7 Answers, 1 is accepted

Sort by
0
plamen
Top achievements
Rank 1
answered on 15 Jan 2008, 03:38 PM
hi :)

I would suggest you to create the TabStrip control in the content page. This example demonstrates dynamic loading UserControls inside the pageviews. Notice the usage of the PageViewItemCreated event to persist the dynamically created controls inside a PageView. Information about how to load the user controls with Ajax can be found at the following online example: http://www.telerik.com/DEMOS/ASPNET/Prometheus/Ajax/Examples/Common/LoadingUserControls/DefaultCS.aspx


I hope this information helps...
<John:Peel />
0
adam
Top achievements
Rank 1
answered on 15 Jan 2008, 03:46 PM
I would stay away from using the Multi-PageView control.  Each Page-View will be created and rendered, which will cause head aches when trying to get only the selected page to be processed.

I am attempting to accomplish a similar task as you.  I have a TabStrip and a ASP Panel that loads a user control based on the TabStrip.  I had this working just fine in Q2 2007 RadControls, but after upgrading to Q3 with Prometheus, the AJAX is much different and I find it to be less user friendly.

Good luck.
0
Steve
Top achievements
Rank 2
answered on 15 Jan 2008, 04:24 PM
I agree...for my implementation, using the MultiPageView with the TabStrip would not work.  We're talking site navigation here, not just a single page that has some secondary info that you might want to show on tabs (like a "Customer Details" page where you might want to show a "Product Order History" on one tab, "Contacts" on another).  My site will have WAY too many pages for that.

I actually have the TabStrip in the master loading user control successfully in a Panel on the Content Page.  The problem is centering around Prometheus RadGrid.  If I have a user control with a grid on it, I can get it to load and sort on columns successfully, all Ajax-ed.  But when I try to employ either of the two methods we are going to be using for viewing/editing information about a single row (either poping up a RadWindow or loading an "edit details" user control in the full content area), I can't get the Ajax wiring correct.  I either get control disappearing or javascript errors coming out of ScriptResource.axd (something I cannot control).

Hopefully the guys and girls at Telerik can throw together a basic app with the framework I've described and help with the Ajax wiring.  I have to get this done or I'm going to lose my mind.
0
Steve
Top achievements
Rank 2
answered on 16 Jan 2008, 02:05 AM
Telerik...are you out there?  Are you going to be able to help or do you need more info?
0
Missing User
answered on 16 Jan 2008, 01:50 PM
Hi Steve,


The attached example demonstrates how to use RadWindow Prometheus for editing RadGrid Prometheus records in UserControl.

Below I describe the needed steps to use RadWindow for editing:

  1. For each GridDataItem in the ItemCreated handler find the Hyperlink instance inside the template column. 
  2. Attach a javascript function to the onclick attribute of that anchor which opens RadWindow (passing the primary key for the currently created item as an argument to that function). 
  3. Open the popup window calling window.radopen() and passing the primary key in the query string of the new window. 
  4. In the content page of RadWindow retrieve the cell values from the grid source which correspond to the primary key from the query string and display them in editable textboxes. 
  5. Edit the content in the textboxes, update the row in the grid source, close the popup window and refresh the grid calling the RadAjaxManager.ajaxRequestWithTarget method

Don't hesitate to contact us if you have any other questions.



Kind regards,

Plamen

the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
0
Steve
Top achievements
Rank 2
answered on 17 Jan 2008, 08:47 PM
Plamen, thanks for the effort but if you read my original post, my problem wasn't with editing a Prometheus RadGrid row with a Prometheus RadWindow.  I would try to explain my original post here, but just look at the very first post in this thread.  If you don't understand my issue from reading that, let me know.  Again, all your help is appreciated.
0
plamen
Top achievements
Rank 1
answered on 21 Jan 2008, 09:34 AM
hi

You can use RadAjaxManagerProxy to ajaxify the UserControl. The proxy control is configured the same way as the manager design-time so ajaxifying that is completely codeless. The manager proxy control requires script manager reference as well on the same page, so use ASP:ScriptManagerProxy along with our RadAjaxManagerProxy.

More information can be found at:
http://www.telerik.com/help/radcontrols/prometheus/?ajxUserControls.html


Thank you...
<John:Peel />
Tags
Ajax
Asked by
Steve
Top achievements
Rank 2
Answers by
plamen
Top achievements
Rank 1
adam
Top achievements
Rank 1
Steve
Top achievements
Rank 2
Missing User
Share this question
or