ASPXGridView在编辑模式下级联输入控件

时间:2015-05-03 08:26:55

标签: c# asp.net callback devexpress aspxgridview

我的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#

0 个答案:

没有答案