What I need to do is this, I need to pass a value into my radwindow to fill out a checkbox list with items that are checked per what region they pick on the radgrid. So if they pick on a region and it has stations the radwindow will open with those stations already picked in the checkboxlist. How can I do this.
<
telerik:RadGrid
ID
=
"myRadGrid"
runat
=
"server"
Width
=
"40%"
Skin
=
"Web20"
CssClass
=
"dvGridWrapper"
>
<
MasterTableView
AutoGenerateColumns
=
"false"
Font-Size
=
"10"
DataKeyNames
=
"intRegionID"
CommandItemDisplay
=
"Top"
>
<
HeaderStyle
ForeColor
=
"White"
Font-Bold
=
"true"
HorizontalAlign
=
"Center"
/>
<
ItemStyle
HorizontalAlign
=
"Center"
/>
<
AlternatingItemStyle
BackColor
=
"#B0C4DE"
HorizontalAlign
=
"Center"
/>
<
Columns
>
<
telerik:GridEditCommandColumn
UniqueName
=
"EditCommandColumn"
></
telerik:GridEditCommandColumn
>
<
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
>
I am filling out hte Radwindow right now on page load but I need the items checked that actually need to be checked from the reagion that they pick.
Private Sub FIllCb()
sql = "select t.intTeamID, t.strTeamCode + ' - ' + t.strTeamName + ' (' + r.strRegionCode + ')' from Team as t left outer join Region as r on t.intRegionID = r.intRegionID"
buildDD(sql, cbTeams)
End Sub
7 Answers, 1 is accepted

Private Sub FillCbToRegion(ByVal region As Integer)
sql = "select intTeamID from Team where intRegionId = " & region & " and bitActive = 1"
myDataTable = New DataTable
myDataTable = getData(sql)
For Each row As DataRow In myDataTable.Rows
For Each Item As ListItem In cbTeams.Items
cbTeams.SelectedValue = row(0)
Next
Next
lnkClearAll.Text = region
End Sub
If (e.CommandName = "Assign") Then
Dim Region As Integer = e.CommandArgument
FillCbToRegion(Region)
End If
I advise that you examine the following demo that shows one way to pass querystring values to a RadWindow from a RadGrid: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window. It uses an <asp:QueryStringParameter> in the SqlDataSource in EditFormcs.aspx page. This is one way to get data from a querystring. The other is to use server code and access it through the Request.Querystring collection, so you can run your code in the content page. In both cases you must make sure that the URL is formed correctly. You can easily test it with window.open instead of window.radopen() because the browser offers an address bar where you can see the URL.
I am adding here a simple example that obtains the querystring values passed from the JavaScript function in the code-behind of the dialog page. You can use this logic to access these values. This example is based on the demo I linked above and uses the database from our demos. You can change the column names and use your own.
Regards,
Marin Bratanov
Telerik

Is there a straight forward way to POST data into RadWindow where the URL is a different domain/URL than the parent page that loads it. Any help is appreciated.
Hello Brian,
If you can POST data in the desired manner to a simple iframe with the page from the other domain, the same approach would work with RadWindow. Note that RadWindow sets the src of its iframe with JavaScript when you call its show() or setUrl() method.
I am not aware of ways to do that, though, as the JavaScript same-origin policy will not let JavaScript access that other page in the iframe in order to generate a new POST.
If you only need to create a POST request and put the result in a RadWindow - you can use its ContentTemplate and set the desired HTML there once you receive it, but the RadWindow itself does not offer such a facility to generate custom requests.
Regards,
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Please try the following options to pass a value from one page to another. These options are valid only if both sender and receiver page is on the same application.
- Session
- Cookies
- Cache
- Application Variables
- Http Context
Thanks,
Shinu.

Hello Brian,
You can use the set_contentElement(domElement) method listed in the control's Client-side API reference: http://www.telerik.com/help/aspnet-ajax/window-programming-radwindow-methods.html.
Regards,
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.