I have two drop downs (The first AsgTo contains a list of people (it has duplicates) this is why the Value filed is set to the unique id). I think take this ID and requery the same table for the 2nd drop down (This will be a hidden field that the users wont see). But how do I make it so RadComboBox1 is bound to the field "procreq_asgto", I cant do "SelectValue=<%# Bind("procreq_asgto")%>" as it comes back with an error because Im binding int he VB code. Ideas?
| <tr> |
| <td style="width:25%;"> |
| Team</td> |
| <td> |
| <telerik:RadComboBox ID="AsgTo" runat="server" DataSourceID="Asg2SQL" AutoPostBack="true" |
| DataTextField="mfgasgto_team" DataValueField="mfgasgto_id" MarkFirstMatch="true" EmptyMessage="Select One" |
| OnSelectedIndexChanged="SelectedIndexChanged" AllowCustomText="true"> |
| </telerik:RadComboBox> |
| <telerik:RadComboBox ID="RadComboBox1" runat="server" MarkFirstMatch="True"> |
| </telerik:RadComboBox> |
| </td> |
| </tr> |
| Protected Sub SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) |
| 'first reference the edited grid item through the NamingContainer attribute |
| Dim editedItem As GridEditableItem = CType(CType(sender, RadComboBox).NamingContainer, GridEditableItem) |
| Dim StatusBox As TextBox = CType(editedItem.FindControl("procreq_status"), TextBox) |
| Dim RequestorBox As RadTextBox = CType(editedItem.FindControl("RadTextBox4"), RadTextBox) |
| StatusBox.Text = "1" |
| RequestorBox.Text = Context.User.Identity.Name.ToString() |
| Dim PersonValue As RadComboBox = CType(editedItem.FindControl("AsgTo"), RadComboBox) |
| Dim PersonBox As RadComboBox = CType(editedItem.FindControl("RadComboBox1"), RadComboBox) |
| Asg2PersSQL.SelectCommand = "SELECT [mfgasgto_person] FROM [mfg_asgto] WHERE [mfgasgto_id] = " + PersonValue.SelectedValue |
| PersonBox.DataSource = Asg2PersSQL |
| PersonBox.DataTextField = "mfgasgto_person" |
| PersonBox.DataValueField = "mfgasgto_person" |
| PersonBox.DataBind() |
| End Sub |