
<script type="text/javascript" id="telerikClientEvents1">//<![CDATA[ function SaleEventsRadGrid_OnRowSelected(sender,args) { //find and set some other controls. then do the following to rebind a grid on another tab: $find("<=RadAjaxManager1.ClientID%>").ajaxRequest(); }//]]></script>


I have the following Combobox
<telerik:RadComboBox ID="cbAcctType" runat="server" DataValueField="ACCT_TYPE_ID" DataTextField="acct_code" RenderMode="Classic" AutoPostBack="True" CausesValidation="False" Width="100%" DropDownWidth="400px" HighlightTemplatedItems="True" InputCssClass="required_cb" EnableLoadOnDemand="true" AppendDataBoundItems="True"> <ItemTemplate> <asp:Table runat="server" CellPadding="0" CellSpacing="0" Width="100%" GridLines="None"> <asp:TableRow> <asp:TableCell Width="30%"> <%# DataBinder.Eval(Container.DataItem, "acct_code") %> </asp:TableCell> <asp:TableCell Width="70%"> <%# DataBinder.Eval(Container.DataItem, "acct_description") %> </asp:TableCell> </asp:TableRow> </asp:Table> </ItemTemplate></telerik:RadComboBox>
and I bind it with the following code:
cbAcctType.DataSource = ds.Tables("AcctType")cbAcctType.DataBind()
Sometimes the code associated with an account will expire and no longer be available in the available list, but it still exists so I have to individually retrieve it and add it to the combobox list. Here is my code for that process
Dim oItem As New RadComboBoxItemoItem.DataItem = ds.Tables(0).Rows(0)oItem.Value = ds.Tables(0).Rows(0).Item("ACCT_TYPE_ID").ToStringoItem.Text = ds.Tables(0).Rows(0).Item("acct_code").ToStringoItem.Selected = TruecbAcctType.Items.Add(oItem)
And that's where the wheels come off. The items is there but only sort of. It will get selected but there is no items in the list. and it usually throws and ASPX page error the <%# DataBinder.Eval(Container.DataItem, "acct_code") %> doesn't exist.
What is the piece of the puzzle that's missing? I have tried it with oItem.DataBind() and that doesn't solve things.


I am trying to populate a RadComboBox dynamically based on the selected of another RadComboBox in EditFormSettings.
Here is a code snippet of what I'm trying to do:
<telerik:RadGrid RenderMode="Lightweight" ID="rgEmployeeAssignments" Width="100%" AllowFilteringByColumn="True"
OnItemCommand="rgEmployeeAssignments_ItemCommand" AllowSorting="True" AllowPaging="True" PageSize="20" runat="server" AutoGenerateColumns="False"
ShowStatusBar="true" OnUpdateCommand="rgEmployeeAssignments_UpdateCommand">
<MasterTableView DataKeyNames="EmployeeID" ClientDataKeyNames="EmployeeID" TableLayout="Fixed">
<Columns>
<telerik:GridEditCommandColumn HeaderText="Edit" HeaderStyle-Width="40px" UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn>
<telerik:GridBoundColumn UniqueName="WORKGROUP" DataField="WORKGROUP" HeaderText="Work Group" HeaderStyle-Width="100px">
<FilterTemplate>
<telerik:RadComboBox RenderMode="Lightweight" ID="rcbWorkGroup" DataSourceID="SQL_WorkGroup"
DataTextField="WORKGROUP" DataValueField="WORKGROUP" Width="100px" AppendDataBoundItems="true"
SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("WORKGROUP").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="TitleIndexChanged">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="rsbWorkGroup" runat="server">
<script type="text/javascript">
function TitleIndexChanged(sender, args) {
var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
tableView.filter("WORKGROUP", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="WORKGROUPOPTION" DataField="WORKGROUPOPTION" HeaderText="Work Group Options" HeaderStyle-Width="100px">
<FilterTemplate>
<telerik:RadComboBox RenderMode="Lightweight" ID="rcbWorkGroupOption" DataSourceID="SQL_WorkGroupOptions"
DataTextField="WORKGROUPOPTION" DataValueField="WORKGROUPOPTION" Width="100px" AppendDataBoundItems="true"
SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("WORKGROUPOPTION").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="TitleIndexChanged">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="rsbWorkGroupOption" runat="server">
<script type="text/javascript">
function TitleIndexChanged(sender, args) {
var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
tableView.filter("WORKGROUPOPTION", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<table id="tblEmployeeAssignmentDetails" width="100%">
<tr class="EditFormHeader">
<td colspan="2">
<b>Employee Assignment Details</b>
</td>
</tr>
<tr>
<td>
<table id="tblEmployeeAssignmentDetailsEdit" width="450px">
<tr>
<td>Work Group:</td>
<td>
<telerik:RadComboBox RenderMode="Lightweight" ID="rcbWorkGroup" DataSourceID="SQL_WorkGroup"
DataTextField="WORKGROUP" DataValueField="ID" Width="100px" AppendDataBoundItems="true"
SelectedValue='<%#Eval("ID")%>' runat="server" AutoPostBack="true" OnSelectedIndexChanged="rcbWorkGroup_IndexChanged">
<Items>
<telerik:RadComboBoxItem Text="-- CHOOSE --" />
</Items>
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td>Work Week:</td>
<td>
<telerik:RadComboBox RenderMode="Lightweight" ID="rcbWorkGroupOptions" DataTextField="WORKGROUPOPTION"
DataValueField="WORKGROUPOPTION" Width="100px" AppendDataBoundItems="true" runat="server"
OnItemRequested="rcbWorkGroup_ItemsRequested" OnClientItemsRequesting="GetSeletecteItem">
<Items>
<telerik:RadComboBoxItem Text="-- CHOOSE --" />
</Items>
</telerik:RadComboBox>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" colspan="2">
<asp:Button ID="btnUpdate" Text="Update" runat="server" CommandName="Update"></asp:Button>
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
<PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="" />
</telerik:RadGrid>
My Codebehind for the IndexChanged event is:
Protected Sub rcbWorkGroup_IndexChanged(sender As Object, e As RadComboBoxSelectedIndexChangedEventArgs)
Dim x = 1
End Sub
I will hit the breakpoint when the workgroup is selected but I do not know how to fill the workgroupoptions combo in the SelectedIndexChanged sub.
