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

Fill Checkboxlist on Show of radwindow

3 Answers 127 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 07 May 2013, 05:07 PM
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>

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 08 May 2013, 11:05 AM
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.
0
Kevin
Top achievements
Rank 1
answered on 09 May 2013, 01:10 PM
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.
0
Marin Bratanov
Telerik team
answered on 10 May 2013, 12:51 PM
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.
Tags
Window
Asked by
Kevin
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Kevin
Top achievements
Rank 1
Share this question
or