Ext.Net RadioGroup CheckedItems is always null

泄露秘密 提交于 2019-12-22 00:55:07

问题


I'm seeing strange behaviour from Ext.Net 2.0: RadioGroup.CheckedItems is always zero in my change handler callback. In my code below RadioGroup1.CheckedItems is ALWAYS zero after checking. What am I doing wrong / how can I solve this?

[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;
        }
    }  
}

My calling code:

<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> 

回答1:


I just answered this exact same question on the Ext.NET forums, then came over to Stack to see what's new today... and found this question.

http://forums.ext.net/showthread.php?18364

You might need to wait for the next Ext.NET v2 release. Your sample appears to be working fine with the latest source. There's a complete working example at the link above.



来源:https://stackoverflow.com/questions/10120514/ext-net-radiogroup-checkeditems-is-always-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!