hi there. I'm Stuck
wondering if a sample exists that could demonstrate how one would relate two comboboxes when in edit/insert mode within a radgrid.
I have the following source / code combo
Note the gridTemplate is where I was wanting to do my compares.. but if i could do it using the griddropdown feature, that sure would be easier.
I have looked at the demos on relating radcombos, and don't have any issue when working with these independentanly. my issues arise when trying to work with them in a radgrid or similar container. My assumption is that I am not referencing the objects correctly.
thanks for any tips oh and if there is a preferred method, please feel free to state.
my code first:
my source
wondering if a sample exists that could demonstrate how one would relate two comboboxes when in edit/insert mode within a radgrid.
I have the following source / code combo
Note the gridTemplate is where I was wanting to do my compares.. but if i could do it using the griddropdown feature, that sure would be easier.
I have looked at the demos on relating radcombos, and don't have any issue when working with these independentanly. my issues arise when trying to work with them in a radgrid or similar container. My assumption is that I am not referencing the objects correctly.
thanks for any tips oh and if there is a preferred method, please feel free to state.
my code first:
Sub updateCB2() |
Dim cb2 As RadComboBox = DirectCast(RadGrid1.FindControl("RadComboBox2"), RadComboBox) |
Dim cb1 As RadComboBox = DirectCast(RadGrid1.FindControl("RadComboBox1"), RadComboBox) |
cb2.DataSource = functions.dt("Select SubGroup as DepartmentGroup from ATS_CareerTypes where career = '" & cb1.SelectedValue & "'") |
cb2.DataBind() |
End Sub |
Protected Sub selectTems(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) |
updateCB2() |
End Sub |
my source
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:PHCJobPostsConn %>" |
SelectCommand="SELECT distinct [Career] FROM [ATS_CareerTypes]" /> |
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:PHCJobPostsConn %>" |
SelectCommand="SELECT distinct [SubGroup] as DepartmentGroup FROM [ATS_CareerTypes]" /> |
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:PHCJobPostsConn %>" |
SelectCommand="SELECT [Dpt_External], [Dpt_Internal], [Career], [DepartmentGroup], [Position_Type], [Department_Name], [PostingNumber] FROM [ExternalPostings]"> |
</asp:SqlDataSource> |
<br /> |
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateEditColumn="True" DataSourceID="SqlDataSource3" |
GridLines="None"> |
<MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource3"> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px" /> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px" /> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridCheckBoxColumn DataField="Dpt_External" DataType="System.Boolean" HeaderText="Dpt_External" |
SortExpression="Dpt_External" UniqueName="Dpt_External"> |
</telerik:GridCheckBoxColumn> |
<telerik:GridCheckBoxColumn DataField="Dpt_Internal" DataType="System.Boolean" HeaderText="Dpt_Internal" |
SortExpression="Dpt_Internal" UniqueName="Dpt_Internal"> |
</telerik:GridCheckBoxColumn> |
<telerik:GridTemplateColumn UniqueName="TemplateColumn" > |
<eDITItemTemplate> |
<telerik:RadComboBox ID="RadComboBox1" AutoPostBack="true" runat="server" |
DataSourceID="SqlDataSource1" DataTextField="Career" DataValueField="Career" |
SelectedValue='<%# bind("career") %>' |
OnSelectedIndexChanged="selectTems"> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</telerik:RadComboBox> |
<telerik:RadComboBox ID="RadComboBox2" runat="server" DataSourceID="SqlDataSource2" |
DataTextField="DepartmentGroup" DataValueField="DepartmentGroup" |
SelectedValue='<%# Bind("DepartmentGroup") %>'> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</telerik:RadComboBox> |
<br /> |
</EDITItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridDropDownColumn UniqueName="CareerGroup" HeaderText="Career" ListValueField="Career" ListTextField="Career" DataField="Career" DataSourceID="SQLDataSource1" DropDownControlType="DropDownList" /> |
<telerik:GridDropDownColumn HeaderText="SubGroup" ListValueField="DepartmentGroup" ListTextField="DepartmentGroup" DataField="DepartmentGroup" DataSourceID="SQLDataSource2" DropDownControlType="DropDownList" UniqueName="DepartmentGroup" /> |
<telerik:GridBoundColumn DataField="Position_Type" HeaderText="Position_Type" SortExpression="Position_Type" |
UniqueName="Position_Type"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Department_Name" HeaderText="Department_Name" |
SortExpression="Department_Name" UniqueName="Department_Name"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="PostingNumber" HeaderText="PostingNumber" SortExpression="PostingNumber" |
UniqueName="PostingNumber"> |
</telerik:GridBoundColumn> |
</Columns> |
</MasterTableView> |
<FilterMenu EnableTheming="True"> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</FilterMenu> |
</telerik:RadGrid><br /> |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="RadComboBox1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="RadComboBox1" /> |
<telerik:AjaxUpdatedControl ControlID="RadComboBox2" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |