我看到来自 Ext.Net 2.0 的奇怪行为: RadioGroup.CheckedItems 在我的更改处理程序回调中始终为零。在 RadioGroup1.CheckedItems 下面的代码中,检查后始终为零。我在做什么错/我该如何解决这个问题?
[DirectMethod]
public void TxtVisibility()
{
foreach (var item in RadioGroup1.CheckedItems)
{
if (item.ID == "rdHourly")
{
txtPerHour.Hidden = false;
txtAtTime.Hidden = true;
}
else if (item.ID == "rdAtHourly")
{
txtPerHour.Hidden = true;
txtAtTime.Hidden = false;
}
}
}
我的调用代码:
<ext:RadioGroup ID="RadioGroup1"
runat="server"
FieldLabel=""
ColumnsNumber="1">
<Items>
<ext:Radio ID="rdHourly" FieldLabel="IsEveryPerHour"
Name="IsEveryPerHour" runat="server"
BoxLabel="Per Hour(s)" Padding="10">
</ext:Radio>
<ext:Radio ID="rdAtHourly" FieldLabel="IsAtHour"
Name="IsAtHour" runat="server"
BoxLabel="At" Padding="10">
</ext:Radio>
</Items>
<Listeners>
<Change Handler="App.direct.TxtVisibility();" ></Change>
</Listeners>
</ext:RadioGroup>