This is a migrated thread and some comments may be shown as answers.

Using two combo box

0 Answers 36 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Vijayaragavan
Top achievements
Rank 1
Vijayaragavan asked on 28 Jun 2010, 12:20 PM
Hi

      Am using two Combo box inside a repeater control.
      The first combobox is multi selectable.
      When I select a value in first combo box, it will give a return field.
      And this return field should be the made available in the second combo box.

      Can you suggest me to solve this?

     Please see the code below

ASPX:

<asp:Repeater ID="repLineDetDistItems" OnItemDataBound="repLineDetDistItems_ItemDataBound" runat="server">
<HeaderTemplate>
<tr>
<td><asp:Label runat="server" ID="lblbProNum" Text="~Proj_No~"></asp:Label></td>
<td><asp:Label runat="server" ID="Label42" Text="~WO~"></asp:Label></td>
</tr>
</HeaderTemplate>

<ItemTemplate>
<td>
    <searchpicker:SearchPicker ID="col1" runat="server"   
           SearchPickerType="ProjNumberLineNumberMultiFields2Selection" />
</td>
<td>
    <searchpicker:SearchPicker ID="col2" runat="server"   
           SearchPickerType="ProjNumberLineNumberMultiFields2Selection" />
</td>

c#

((SearchPicker)e.Item.FindControl("col1")).ReturnFields = ((SearchPicker)e.Item.FindControl("col1")).ClientID;

((SearchPicker)e.Item.FindControl("col2")).ComboBox.Text = ((SearchPicker)e.Item.FindControl("col1")).Text;
((SearchPicker)e.Item.FindControl("col2")).Value = ((SearchPicker)e.Item.FindControl("col1")).Text;

also used another method:

Given a hidden text box, and i have set the value for this is return field of 1 column
and on text change event of this hidden text box, written this JS as below

function show(col1, col2) {
            debugger;
            var ctrl = col2;
            ctrl.set_text = col1.value;
            ctrl.set_value = col1.value;
            //col2.value = col1.value;
        }





No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Vijayaragavan
Top achievements
Rank 1
Share this question
or