Fill Checkboxlist on Show of radwindow

4 posts, 0 answers
  1. Kevin
    Kevin avatar
    265 posts
    Member since:
    Jun 2011

    Posted 07 May 2013 Link to this post

    What I have is a linkbutton with a command name on myradgrid to call my radwindow.  So what I need to do is populate the checkbox list that sits in myradwindow on the click of this linkbutton, to populate the checkbox list and see if anything exists check the boxes if not check nothing.

    Right now just trying to figure how I can get the checkboxes to populate.  After this I will need to pass a value to either populate the list with checkboxes or not depending if saved in DB.

    <telerik:RadWindow ID="RadTeams" runat="server" Width="500px" Height="250px" Enabled="true" Modal="true" VisibleTitlebar="false" VisibleStatusbar="false" CssClass="CentTable">
               <ContentTemplate>
                   <table class="CentTable">
                       <tr>
                           <td style="text-align:center">Please Pick Teams to Assign to Region</td>
                       </tr>
                       <tr>
                           <td style="height:5px" ></td>
                       </tr>
                       <tr>
                           <td>
                               <asp:CheckBoxList ID="cbTeams" runat="server" AutoPostBack="false" RepeatDirection="Horizontal" RepeatColumns="3" TextAlign="Right"></asp:CheckBoxList>
                           </td>
                       </tr>
                       <tr>
                           <td style="text-align:center">
                               <asp:LinkButton ID="lnkSubmit" runat="server" Text="Submit"></asp:LinkButton>
                                    
                               <asp:LinkButton ID="lnkCancel" runat="server" Text="Cancel"></asp:LinkButton>
                           </td>
                       </tr>
                   </table>
               </ContentTemplate>
           </telerik:RadWindow>



    <telerik:GridTemplateColumn>
              <ItemTemplate>
                          <asp:LinkButton ID="lnkAssign" runat="server" CommandArgument='<%# Bind("strRegionCode")%>' Text="Assign Teams" CommandName="Assign" OnClientClick='<%# String.Format("addAdminWin({0}, {1}); return false;", Eval("intRegionID"), 2)%>'></asp:LinkButton>
                  </ItemTemplate>
    </telerik:GridTemplateColumn>
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 08 May 2013 Link to this post

    Hello Kevin,

    The following demo can show you how you can access the controls in the ContentTemplate of a RadWindow, both in server code, and in JavaScript, in order to modify them as you logic dictates: http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx.


    Kind 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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kevin
    Kevin avatar
    265 posts
    Member since:
    Jun 2011

    Posted 09 May 2013 Link to this post

    HI,

    Ok thats great already been there looked at it. It is a simple method that I can already do, what it does not show is how to load controls on popup within a radgrid link button click.  Do you have any examples of this.
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 10 May 2013 Link to this post

    Hi Kevin,

    If you load an entire page in the RadWindow you cannot load controls in the same popup.

    Otherwise, adding controls to the ContentTemplate of a RadWindow is not different than adding controls to a simple ASP:Panel control, for example
    RadWindow1.ContentContainer.Controls.Add(new LiteralControl("some text"));

    Since this is a dynamic control you would need to find a way to persist it across postbacks, like any other dynamic control. This article and this demo can be helpful in this regard.

    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.
Back to Top