DevExpress ASPxComboBox lost selected item after postback

时间:2023-03-09 18:24:35
DevExpress ASPxComboBox lost selected item after postback
<dx:ASPxComboBox ID="cbxSname" ClientInstanceName="cbxSname" Font-Names="微软雅黑" Font-Size="12px"
runat="server" EnableCallbackMode="true" CallbackPageSize="20" Width="170px"
IncrementalFilteringMode="Contains" ValueType="System.Int32" ValueField="Gong_sid"
OnItemsRequestedByFilterCondition="cbxSname_OnItemsRequestedByFilterCondition"
OnItemRequestedByValue="cbxSname_OnItemRequestedByValue" TextFormatString="{0}"
DropDownStyle="DropDown" MaxLength="100">
<Columns>
<dx:ListBoxColumn FieldName="Gong_smch" Caption=" " Width="50px" />
</Columns>
</dx:ASPxComboBox>

Code is above. When you use this, make sure the value field type match the attribute ValueType which means if you have an int primary key value field, then set the ValueType to System.Int32. Or
you will meet this issue.