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

Problem to open a RadWindow when i click on a LinkButton

3 Answers 191 Views
Window
This is a migrated thread and some comments may be shown as answers.
Adigard
Top achievements
Rank 1
Adigard asked on 28 Oct 2011, 02:37 PM
Greetings,

Despite the help i can find on the Internet , i still cannot manage to open a radwindow when i click on a LinkButton...

here is my code:

<asp:Repeater runat="server" DataSourceID="SqlDataSourceRDVUtilisateur">
    <ItemTemplate>
        <br />
        <asp:LinkButton ID="RDVUtilisateur" runat="server"><%#Eval("objet") %></asp:LinkButton>
    </ItemTemplate>
</asp:Repeater>

The RadWindow i have added:

<telerik:RadWindow ID="RadWindow1" runat="server" OpenerElementID="RDVUtilisateur"
    VisibleOnPageLoad="false">

I already have a RadScriptManager in my masterpage


Question 2 : Is it possible to send an id in this linkButton and to get it back in the RadWindow?


thanks in advance !

3 Answers, 1 is accepted

Sort by
0
Adigard
Top achievements
Rank 1
answered on 28 Oct 2011, 03:17 PM
Ok, this is seems to work with this :

<script type="text/javascript">
    function OpenWnd() {
        radopen(null, "RadWindow1");
    }
 
</script>
<asp:Repeater runat="server" DataSourceID="SqlDataSourceRDVUtilisateur">
    <ItemTemplate>
        <br />
        <asp:LinkButton ID="RDVUtilisateur" runat="server" OnClientClick="OpenWnd();return false;"
            CommandArgument="<%#Eval("idRDV")%>"><%#Eval("objet") %></asp:LinkButton>
    </ItemTemplate>
</asp:Repeater>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista">
    <Windows>
        <telerik:RadWindow Skin="Vista" ID="UserListDialog" runat="server" Title="User List Dialog"
            Height="500px" Width="300px" Left="150px" ReloadOnShow="true" Modal="true" />
    </Windows>
</telerik:RadWindowManager>

But the enableshadow property doesnt seem to work properly!
And i would still like to know how to get back in my Radwindow the value i have in CommandArgument my LinkButton...
thank you
0
Accepted
Marin Bratanov
Telerik team
answered on 31 Oct 2011, 09:21 AM
Hi Adigard,

I am glad to see that you have figured out the correct way to open a RadWindow. As for the command argument - this is not available on the client side, you can examine this google search on the matter and more precisely this thread may be useful to you. Once you obtain the needed information you can pass it to the RadWIndow via JavaScript. More information on how to do so is available in this help article and you can see the approach in action in this online demo. You can also call a function form the page in the RadWindow and pass the information as an argument to it.


Regards,
Marin
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
Adigard
Top achievements
Rank 1
answered on 31 Oct 2011, 09:25 AM
Thanks a lot for your help.
I also used this to pass arguments :

 

http://demos.telerik.com/aspnet-ajax/window/examples/usingurlforserverarguments/defaultcs.aspx

This is perfectly working!

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