<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
var ajaxmanager;
function pageLoad()
{
ajaxmanager = $find('<%= Master.FindControl("RadAjaxManager1").ClientID %>');
}
function openWin()
{
var oWnd = radopen("AccountSearch.aspx", "rwAcctSearch");
oWnd.setSize (360, 160);
oWnd.maximize();
oWnd.restore();
oWnd.center();
oWnd.set_title("Account Number");
// remove the handler each time or it will get called
// an additional time for each successive close event
oWnd.remove_close(OnClientClose);
oWnd.add_close(OnClientClose);
}
function OnClientClose(oWnd,args)
{
// get the transferred arguments
var arg = args.get_argument();
if(arg)
{
// trim value
var acntNbr = arg.acntNbr.replace(/^\s+|\s+$/g,"");
ajaxmanager.ajaxRequest(acntNbr);
}
}
</script>
</telerik:RadCodeBlock>
<input id="btnSendRfn" type="button" style="width: 225px; font-size: x-small;"
value="Send RFN" onclick="openWin(); return false;" />
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"
VisibleOnPageLoad="false" ShowContentDuringLoad="false"
ReloadOnShow="true" VisibleStatusbar="false">
<Windows>
<telerik:RadWindow ID="rwAcctSearch" runat="server" Modal="true"
Behaviors="Close">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
</asp:Content>
<
telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista"
KeepInScreenBounds="True" >
<Windows>
<telerik:RadWindow Skin="Vista" ID="NewsDialog" runat="server" Title="News" Height="625px"
Width="700px" Left="150px" ReloadOnShow="true" Modal="true" KeepInScreenBounds="True" />
</Windows>
</telerik:RadWindowManager>

I have to rad combo boxes, RadLaborSchedule (rad1) and RadLaborCatDesc (rad2). Both these rad combo boxes are declared as EditItems in a radgrid. How do I populate rad2 with selected value of rad1?
I tried using this code in javascript, which errors out at compile time because RadLaborCatDesc can not be found, being an edit item of a rad grid.
Thanks.
Suresh
Here is the javascript:
//global variables for the countries and cities comboboxes
var LaborCatCombo;
function pageLoad()
{
// initialize the global variables
// in this event all client objects
// are already created and initialized
LaborCatCombo = $find(
"<%= RadComboBoxLaborCatDesc.ClientID %>");
}
function LoadLaborCategories(combo, eventArqs)
{
var item = eventArqs.get_item();
LaborCatCombo.set_text(
"Loading...");
LaborCatCombo.clearSelection();
// if a labor schedule is selected
if (item.get_index() > 0)
{
// this will fire the ItemsRequested event of the
// countries combobox passing the continentID as a parameter
LaborCatCombo.requestItems(item.get_value(),
false);
}
else
{
// the -Select a continent- item was chosen
LaborCatCombo.set_text(
" ");
LaborCatCombo.clearItems();
}
}
And this is the radgrid declaration:
<telerik:GridTemplateColumn DataField="LaborSchedule" HeaderText="Labor Schedule" UniqueName="LaborSchedule">
<ItemTemplate >
<asp:Label id="LabelLaborSchedule" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "LaborSchedule")%>'
></asp:Label>
</ItemTemplate>
<ItemStyle Width="500px" />
<EditItemTemplate>
<telerik:RadComboBox DataTextField="LaborSchedule"
DataValueField="LaborSchedule"
AutoPostBack="false"
EnableLoadOnDemand="True"
ID="RadComboBoxLaborschedule"
runat="server"
Height="140px"
Width="100px"
SelectedValue = '<%#DataBinder.Eval(Container.DataItem, "LaborSchedule")%>'
SelectedText = '<%#DataBinder.Eval(Container.DataItem, "LaborSchedule")%>'
DataSourceId = "ObjectDataSourceGetSchedules"
OnItemsRequested= "RadComboBoxLaborschedule_ItemsRequested"
OnClientSelectedIndexChanging="LoadLaborCategories"
>
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="LaborCategoryDesc" HeaderText="LaborCategoryDesc" UniqueName="RadComboBoxLaborCatDesc">
<ItemTemplate>
<asp:Label id="LabelLaborCategoryDesc" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "LaborCategoryDesc")%>'
></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="RadComboBoxLaborCatDesc" runat="server"
DataTextField="LaborCategoryDesc"
DataValueField="LaborCategoryCode"
SelectedValue = '<%#DataBinder.Eval(Container.DataItem, "LaborCategoryCode")%>'
SelectedText = '<%#DataBinder.Eval(Container.DataItem, "LaborCategoryDesc")%>'
DataSourceId = "ObjectDataSourceLabelCategory"
OnItemsRequested= "RadComboBoxLaborCatDesc_ItemsRequested"
AutoPostBack="false"
>
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
| <div id="tabs"> |
| <telerik:RadTabStrip ID="rtsCategoryList" runat="server" skin="" EnableEmbeddedSkins="false" Width="788px" Height="20px" |
| OnTabClick="rtsCategoryList_TabClick" ScrollChildren="true" |
| PerTabScrolling="true" ScrollPosition="0" BackColor="#000000" ScrollButtonsPosition="Right"> |
| </telerik:RadTabStrip> |
| </div> |
Default.aspx.cs (Relevant Portion Only)
| DataTable table = RetrievalProcedures.SpWsGetCategoriesByCityState(_city, _state); |
| // Build the tabs. |
| foreach (DataRow row in table.Rows) |
| { |
| RadTab newTab = new RadTab(); |
| newTab.Value = row["categoryId"].ToString(); |
| newTab.Text = row["categoryName"].ToString(); |
| newTab.CssClass = "tab"; |
| newTab.HoveredCssClass = "tabHover"; |
| newTab.SelectedCssClass = "tabSelected"; |
| rtsCategoryList.Tabs.Add(newTab); |
| } |
| // Set the first tab as selected. |
| rtsCategoryList.Tabs[0].Selected = true; |
main.css (Relevant Portion Only)
| div.divBusinessSearchPanel #tabs |
| { |
| width: 788px; |
| height: 20px; |
| border: 0px; |
| margin-bottom: 0px; |
| } |
| div.divBusinessSearchPanel .tab, div.divBusinessSearchPanel .tabHover, div.divBusinessSearchPanel .tabSelected |
| { |
| display: inline-block; |
| width: 120px; |
| height: 18px; |
| margin: 0px 2px 0px 0px; |
| padding: 2px 0px 0px 0px; |
| font-size: 12px; |
| font-weight: bold; |
| color: #ffffff; |
| text-align: center; |
| } |
| div.divBusinessSearchPanel .tab |
| { |
| background-image: url(/images/ReusableControls/BusinessSearchPanel/bg-tab.png); |
| color: #ffffff; |
| } |
| div.divBusinessSearchPanel .tabHover |
| { |
| background-image: url(/images/ReusableControls/BusinessSearchPanel/bg-tab.png); |
| color: #fff000; |
| } |
| div.divBusinessSearchPanel .tabSelected |
| { |
| background-image: url(/images/ReusableControls/BusinessSearchPanel/bg-tab-selected.png); |
| color: #f0f0f0; |
| } |
| div.divBusinessSearchPanel .rtsPrevArrow |
| { |
| background-color: #eeefff; |
| } |
| div.divBusinessSearchPanel .rtsNextArrow |
| { |
| background-color: #000fff; |
| } |
| <telerik:GridTemplateColumn HeaderText="Type" DataField="Type" > |
| <ItemTemplate> |
| <%# Eval("Type.Name") %> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <telerik:RadComboBox ID="PropertyType" runat="server" Width="250" Height="150" |
| DropDownWidth="300" ShowDropDownOnTextboxClick="true" MarkFirstMatch="true" |
| ShowToggleImage="false" AppendDataBoundItems="true" |
| DataSourceID="PropertyTypes" DataValueField="Id" DataTextField="Name" |
| AllowCustomText="false" SelectedValue='<%# Bind("Type.Id") %>'> |
| <Items> |
| <telerik:RadComboBoxItem Text="" /> |
| </Items> |
| </telerik:RadComboBox> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |