当我设置值ASPXCombobox时。来自null ref异常;
<td>
<dxe:ASPxComboBox ID="cmb" runat="server" AutoPostBack="True" ClientInstanceName="cmb"
EnableCallbackMode="True" EnableSynchronization="False" CallbackPageSize="20" Width="300px"
IncrementalFilteringMode="Contains"
LoadingPanelText="Yükleniyor…" Theme="Aqua">
</dxe:ASPxComboBox>
</td>
Test tt = new Test();
DataTable dt = paf.GetAllItem();
cmb.ValueField = "ID";
cmb.TextField = "NAME";
cmb.DataSource = dt;
cmb.DataBind();
cmbMahPafta.SelectedIndex = -1;
我使用该代码后出现错误。
cmbMahPafta.SelectedItem.Value=user.ID;//Null reference Exception.
如何解决此问题?