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

How to kick off rad window from grid template column

3 Answers 79 Views
Window
This is a migrated thread and some comments may be shown as answers.
KawaUser
Top achievements
Rank 2
KawaUser asked on 19 Aug 2011, 09:10 PM
I have a modal window that I can get to work just fine from a button in the user control but how do I get the rad window to start up from a template column in a grid view inside that user control that looks something like this:

<telerik:GridTemplateColumn HeaderText="" UniqueName="ConfirmNo" AllowFiltering = "false">
<ItemTemplate>
<asp:Button ID="btnConfirmNo" runat="server" Text="No" CommandArgument='<%# Eval("_DocumentID") %>'
                    CommandName="ConfirmNo" />
        <asp:Label ID="lblConfirmNo" runat="server" CssClass="formLabel"></asp:Label>
                     </ItemTemplate>
                  <HeaderStyle HorizontalAlign="Center" />
     <ItemStyle HorizontalAlign="Center" Width="5%" />
</telerik:GridTemplateColumn>

3 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 23 Aug 2011, 08:59 AM
Hello Charles,

The approach would still be the same - call an already existing JavaScript function that will open the RadWIndow (either a standalone via $find("ID"),show(), or via radopen(url, name) from a RadWindowManager). This JavaScript call can be attached to the OnClientClick of a button (where you should cancel the postback via the return false; statement in the handler) or you can inject it from the server-side if you need some server-side functionality to determine the URL for example. You can find attached a simple example that shows the approach. I believe you may also find the following help article useful: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html.


Regards,
Marin
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
KawaUser
Top achievements
Rank 2
answered on 23 Aug 2011, 07:15 PM
Now that I got that working with

function openRadWindow() {
          GetRadWindowManager().open(null, "RadWindow1");
      }

The purpose of this window is for the user to input comments about a document and then submit them backing via a submit button. The one thing I am missing out of all this is how to pass a value to the radwindow. I need this value to be able to submit the comments back to SQL.
0
Marin Bratanov
Telerik team
answered on 25 Aug 2011, 10:56 AM
Hello Charles,

There are several ways to pass values to a RadWindow 
1) via a JavaScript object that you can get in the loaded page again via JavaScript. More information on this approach is available in the documentation and in the online demos
2) when calling a function from the window you can pass a parameter to it as well.
3) you can construct a new URL and pass the information as a querystring. This facilitates the use of code-behind. How to do so is shown in this help article and this online demo.
4) if you are actually using the ContentTemplate (since you do not pass an URL) the RadWindow's content is actually a part of the main page and it can freely access all its objects. This difference is shown in this online demo.

As for passing a value from the RadWindow - this can be done via its closing parameter. This can be seen in the article and demo I linked in point 1) .

I hope the above information will help you choose and implement the option that best fits your needs.


Greetings,
Marin
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Window
Asked by
KawaUser
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
KawaUser
Top achievements
Rank 2
Share this question
or