protected void ASPxButton_pkxz_tj_Click(object sender, EventArgs e)
{
ASPxButton btn = sender as ASPxButton;
if(btn!=null)
{
// btn.Text = btn.Parent.Parent.Parent.Parent.Parent.GetType().ToString();
ContentControl pageControl = btn.Parent as ContentControl;
ASPxComboBox cb = pageControl.FindControl("ASPxComboBox_pkxz_bj_tj") as ASPxComboBox;
cb.Enabled = false;//成功,其余都不成功
}
}
<Templates>
<EditForm>
<center>
<table align="center" class="auto-style39">
<tr>
<td>
<dx:ASPxPageControl ID="ASPxPageControl_pkxz" runat="server" ActiveTabIndex="0" Width="100%" TabAlign="Center" TabSpacing="3px">
<TabPages>
<dx:TabPage Text="添加排课限制条件">
<ContentCollection>
<dx:ContentControl runat="server">
<table align="center" cellpadding="2px" class="table" border="0" style="border-width: 0.1px; border-color: ghostwhite; width:100%;background-color:ghostwhite">
<tr>
<td class="auto-style6"><center>班级</center> </td>
<td class="auto-style15"><center>星期一</center></td>
<td class="auto-style17"><center>星期二</center></td>
<td class="auto-style19"><center>星期三</center></td>
<td class="auto-style21"><center>星期四</center></td>
<td class="auto-style27"><center>星期五</center></td>
<td class="auto-style35"><center>星期六</center></td>
<td class="auto-style37"><center>星期日</center></td>
<td class="auto-style33"><center>科目</center></td>
<td class="auto-style31"><center>动作</center></td>
<td rowspan="2">
</td>
<td rowspan="2">
</td>
</tr>
<tr>
<td class="auto-style10">
<dx:ASPxComboBox ID="ASPxComboBox_pkxz_bj_tj" runat="server" Width="70px" NullText="请选择">
</dx:ASPxComboBox>
</td>
<td class="auto-style16">
<dx:ASPxComboBox ID="ASPxComboBox_pkxz_xq1_tj" runat="server" Width="70px" NullText="请选择">
</dx:ASPxComboBox>
</td>
<td colspan="10" class="auto-style40">
<dx:ASPxButton ID="ASPxButton_pkxz_tj" runat="server" Text="添加" Width="50px" OnClick="ASPxButton_pkxz_tj_Click">
</dx:ASPxButton>
</td>