Two Comboboxes

2 posts, 0 answers
  1. aabdan
    aabdan avatar
    26 posts
    Member since:
    Apr 2007

    Posted 12 Jan 2009 Link to this post

     

    I am setting the same datasource for two comboboxes. If I selected any value in one combo box the same value is reflected in other combobox also.can anyone help to do this issue.

    Thanks
    LPW
  2. aabdan
    aabdan avatar
    26 posts
    Member since:
    Apr 2007

    Posted 12 Jan 2009 Link to this post

    i  found the solution if any body want it,

     

     

    <

     

    script type="text/jscript">

     

     

     

     

     

     

     

     

     

     

    function OnClientSelectedIndexChangedValue(sender, args)

     

    {

     

    var combo = $find("<%= RadComboBoxDescription.ClientID %>");

     

     

    var item = args.get_item();

     

     

    var i = item.get_index();

     

     

     

    if (item.get_value() != combo.get_value())

     

    combo.get_items().getItem(i).select();

    }

     

     

    function OnClientSelectedIndexChangedDescription(sender, args)

     

    {

     

    var combo = $find("<%= RadComboBoxValue.ClientID %>");

     

     

    var item = args.get_item();

     

     

    var i = item.get_index();

     

     

     

    if (item.get_value() != combo.get_value())

     

    combo.get_items().getItem(i).select();

    }

     

     

     

     

     

    function ClientValidate<%= CVRadComboBoxValue.ClientID %>(source, arguments)

     

    {

     

    var comboValue = <%= RadComboBoxValue.ClientID %>;

     

     

    var StrItemText = '<%= RadComboBoxValue.FindItemByValue("-1").Text %>'

     

     

     

     

     

     

    var StrItemText2 = '<%= RadComboBoxValue.FindItemByValue("-2").Text %>'

     

     

     

     

     

     

     

    if (StrItemText == arguments.Value || StrItemText2 == arguments.Value )

     

    {

    arguments.IsValid =

    false;

     

     

    return false;

     

    }

    arguments.IsValid =

    true;

     

     

    return true;

     

    }

     

     

     

    </

     

    script>

     

    <

     

    table style="width: 350px">

     

     

     

     

     

     

    <tr>

     

     

     

     

     

     

    <td style="width: 100px">

     

     

     

     

     

     

    <telerik:RadComboBox ID="RadComboBoxValue" runat="server" OnClientSelectedIndexChanged="OnClientSelectedIndexChangedValue"

     

     

     

     

     

     

    Height="190px" HighlightTemplatedItems="True" MarkFirstMatch="True" AppendDataBoundItems="True"

     

     

     

     

     

     

    Skin="WebBlue" CausesValidation="False">

     

     

     

     

     

     

    <CollapseAnimation Duration="200" Type="OutQuint" />

     

     

     

     

     

     

    </telerik:RadComboBox>

     

     

     

     

     

     

    </td>

     

     

     

     

     

     

    <td style="width: 100px">

     

     

     

     

     

     

    <telerik:RadComboBox ID="RadComboBoxDescription" runat="server" OnClientSelectedIndexChanged="OnClientSelectedIndexChangedDescription"

     

     

     

     

     

     

    Height="190px" HighlightTemplatedItems="True" MarkFirstMatch="True" AppendDataBoundItems="True"

     

     

     

     

     

     

    Skin="WebBlue" CausesValidation="False">

     

     

     

     

     

     

    <CollapseAnimation Duration="200" Type="OutQuint" />

     

     

     

     

     

     

    </telerik:RadComboBox>

     

     

     

     

     

     

    </td>

     

     

     

     

     

     

    <td style="width: 100px">

     

     

     

     

     

     

    <asp:CustomValidator ID="CVRadComboBoxValue" runat="server" ControlToValidate="RadComboBoxValue"

     

     

     

     

     

     

    ErrorMessage="Required" EnableClientScript="true"></asp:CustomValidator></td>

     

     

     

     

     

     

    </tr>

     

    </

     

    table>


    Regards,

     

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top