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

Opening up a radwindow form with existing data from a context menu, from a record on a radgrid

3 Answers 88 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Carina
Top achievements
Rank 1
Carina asked on 11 Dec 2012, 05:13 PM
Hello,

I was hoping to get some help in figuring out how to open up a form that pops up as a rad window when clicked open from the context menu on a record, with its existing data that has been previously input. I tried figuring it out, but it will only open up a new blank form, (although it shows up with the form id pertaining to that record). Is there a reason why the data does not display? I am storing and retrieving data from Management Studio SQL Server db.

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 13 Dec 2012, 12:18 PM
Hi Carina,

If you have set the ReloadOnShow property of the RadWnidow you open to true, or if you have set the manager's DestroyOnClose to true you will lose the content in the form. Here is what would happen in each case:
- ReloadOnShow=true - when you show the RadWindow it will append a random querystring to the provided URL which will perform a new request for the page and the server will return a fresh version. This is the purpose of the property. Setting it to false prevents this logic from executing, so showing a RadWindow with the same URL as the current will not cause a new request. Note that this applies only for the case when you only call the show() method of the control. If you go through the setUrl() method or you pass an URL to the radopen()/open() methods a request for the URL will be performed.
- DestroyOnClose=true - when closed the RadWindow will be disposed, so you cannot re-show the same instance. A new one will be created, so naturally a new request to the server will be made

In case you only pass one parameter in the querystring (e.g. a record ID) you can store it in the RadWindow variable in a custom field and read it after getting the reference but before setting the URL. If it is the same - only call show(), if it is different - setUrl() with the new value.


All the best,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Carina
Top achievements
Rank 1
answered on 08 Jan 2013, 01:28 AM
Hi Marin,

I have those properties set already. When I click on a record, the radwindow pops up with the appropriate ID, but only some fields are filled in, and the rest of the fields are reset. Also, the fields that are filled in, I have to re-select the value so I can update the form again, or it reads them in the code as empty or "". All the values in the DB are filled in for the form, but when it is re-opened from a record, it is not completely filled in. Do you know what I might be doing wrong?
0
Marin Bratanov
Telerik team
answered on 09 Jan 2013, 03:10 PM
Hello Carina,

The ReloadOnShow and DestroyOnClose features both ensure that the page is reloaded completely from the server. This means that either the browser still managers to cache something in the iframe, or your server code does not send all required values. Does the same appraoch work with a regular browser window and with a simple iframe (you can access it via JavaScritp and change its src attribute). If at least one of them does not then the problem stems from your page. Regardless of that I advise that you make sure there aren't JavaScript errors on the pages as they can break functionality. If you are still unable to resolve this I advise that you send us a simple, runnable sample that shows this problem so we can investigate it in case it stems from RadWindow, because I have never seen an issues like that before.


Regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Carina
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Carina
Top achievements
Rank 1
Share this question
or