[CLOSED] How can I check if CheckboxToggle is selected in FieldSet in codebehind

  1. #1

    [CLOSED] How can I check if CheckboxToggle is selected in FieldSet in codebehind

    How can I check if CheckboxToggle is selected in FieldSet in codebehind?
    For example my Fieldset name is FieldSet1, so I must check if it is checked or not.
    So I will check also the values in that filedset to validate the form. If it is not checked I wil not validate the fieldset.
    Thanks...
  2. #2
    Hi,

    Please use .Collapsed property.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void IsChecked(object sender, DirectEventArgs e)
        {
            X.Msg.Alert("CheckboxToggle", (!FieldSet1.Collapsed).ToString()).Show();
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:FieldSet 
            ID="FieldSet1" 
            runat="server" 
            CheckboxToggle="true" 
            Height="70">
            <Items>
                <ext:TextField runat="server" />
            </Items>
        </ext:FieldSet>
        <ext:Button runat="server" Text="Is сhecked?" OnDirectClick="IsChecked" />
        </form>
    </body>
    </html>
    P.S. I think .CheckboxToggle property should work also but it doesn't. I will discuss this issue with Dev team.
  3. #3
    Thank you...
  4. #4
    Quote Originally Posted by Daniil View Post
    P.S. I think .CheckboxToggle property should work also but it doesn't. I will discuss this issue with Dev team.
    No, I was wrong. CheckboxToggle is a just config option. It doesn't determine checkbox's state.

Similar Threads

  1. [CLOSED] Fieldset collapse codebehind
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 03, 2012, 8:23 AM
  2. Determine if the Fieldset checbox is selected
    By n_s_adhikari@rediffmail.com in forum 1.x Help
    Replies: 2
    Last Post: Aug 06, 2009, 6:15 PM
  3. Replies: 2
    Last Post: Apr 21, 2009, 5:42 PM
  4. [CLOSED] FieldSet CheckboxToggle PostBack?
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 07, 2008, 4:47 AM
  5. Replies: 3
    Last Post: Mar 28, 2008, 3:57 PM

Tags for this Thread

Posting Permissions