Problem to open a RadWindow when i click on a LinkButton

4 posts, 1 answers
  1. Adigard
    Adigard avatar
    61 posts
    Member since:
    Oct 2011

    Posted 28 Oct 2011 Link to this post

    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 !
  2. Adigard
    Adigard avatar
    61 posts
    Member since:
    Oct 2011

    Posted 28 Oct 2011 Link to this post

    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
  3. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    4627 posts

    Posted 31 Oct 2011 Link to this post

    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
  4. Adigard
    Adigard avatar
    61 posts
    Member since:
    Oct 2011

    Posted 31 Oct 2011 Link to this post

    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!

Back to Top