Bug Report B196121
Visible to All Users

ASPxComboBox resets value upon postback when ValueType=System.Int32 and SetSelectedIndex(-1) is called on client side

created 14 years ago

Code to reproduce (just place in any .ASPX page):
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <asp:UpdatePanel runat="server" ID="updPanel">
                <ContentTemplate>
                    <devex:ASPxComboBox runat="server" ID="cbxTest" ClientInstanceName="ciTest" ValueType="System.Int32">
                        <Items>
                            <devex:ListEditItem Text="First" Value="23" />
                            <devex:ListEditItem Text="Second" Selected="true" Value="45" />
                            <devex:ListEditItem Text="Third" Value="67"/>
                        </Items>
                    </devex:ASPxComboBox>
                    <a href="javascript:ciTest.SetSelectedIndex(-1);">Reset</a>
                    <asp:Button runat="server" Text="Postback" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </form>
    </body>
</html>
Steps to Reproduce:

  1. Open page; The second item is selected [correct]
  2. Select any other item; press "Postback". The new value stays after the postback [correct]
  3. Press "Reset". The combobox clears [correct]
  4. Press "Postback". The combobox has reset to the value selected in step 2. [incorrect]
    Actual Results:
    Combobox cannot be reset to empty on client side. Any postback causes the previous value to reappear.
    Expected Results:
    After being reset to empty on client side, combobox stays empty even after postbacks. SelectedIndex is -1 and Value is null.
Comments (1)
DevExpress Support Team 14 years ago

    Hi,
    Thank you for the report. I've tried to reproduce this problem using the latest Suite version (10.2.4) but failed. Please install the same Suite version, upgrade your application as it is explained in the Upgrade Notes topic and check how your application works. Please keep us informed of your results.
    Thanks,
    Plato

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.