我的ASPxGridView
用于输入电话号码。我有ComboBox
用于获取号码的“类型”(电话,手机,传真等)。
我还有TextBox
来获取实际数字。我需要将NullText
的{{1}}设置为样本电话或手机号码,具体取决于所选的TextBox
值。
如果按照this demo中的说明,我必须根据ComboBox
填写另一个ComboBox
,这将很容易。
但是ComboBox
没有TextBox
,我可以在那里做我需要的东西。
我的CallBack
代码:
ASPX
我的<dx:ASPxGridView ID="gridPhones" runat="server" ClientInstanceName="gridPhones" EnableRowsCache="false"
AutoGenerateColumns="false" KeyFieldName="TemporaryId" Width="100%"
EnableCallBacks="True"
OnRowDeleting="gridPhones_RowDeleting"
OnRowInserting="gridPhones_RowInserting"
OnRowUpdating="gridPhones_RowUpdating"
OnCellEditorInitialize="gridPhones_CellEditorInitialize">
<Columns>
<dx:GridViewCommandColumn Visible="true">
<EditButton Visible="true"></EditButton>
<UpdateButton Visible="true"></UpdateButton>
<CancelButton Visible="true"></CancelButton>
</dx:GridViewCommandColumn>
<dx:GridViewDataCheckColumn FieldName="IsMain">
<EditFormSettings Visible="True" VisibleIndex="1"></EditFormSettings>
</dx:GridViewDataCheckColumn>
<dx:GridViewDataTextColumn FieldName="TypeTitle">
<EditFormSettings Visible="False"></EditFormSettings>
</dx:GridViewDataTextColumn>
<dx:GridViewDataComboBoxColumn FieldName="Type" Visible="False">
<EditFormSettings Visible="True" VisibleIndex="2"></EditFormSettings>
<PropertiesComboBox ClientInstanceName="cbPhoneType">
<ValidationSettings Display="Dynamic" ErrorDisplayMode="Text">
</ValidationSettings>
</PropertiesComboBox>
</dx:GridViewDataComboBoxColumn>
<dx:GridViewDataTextColumn FieldName="CountryCode">
<EditFormSettings Visible="True" VisibleIndex="3"> </EditFormSettings>
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="CityCode">
<EditFormSettings Visible="True" VisibleIndex="4"></EditFormSettings>
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="Phone">
<EditFormSettings Visible="True" VisibleIndex="5"> </EditFormSettings>
</dx:GridViewDataTextColumn>
</Columns>
<SettingsEditing Mode="EditForm" EditFormColumnCount="5" />
<SettingsBehavior AllowFocusedRow="True" />
</dx:ASPxGridView>
代码:
C#