EnableCheckAllItemsCheckBox "All" entry doesnt fire OnItemChecked event

18 posts, 0 answers
  1. Ken
    Ken avatar
    28 posts
    Member since:
    Sep 2012

    Posted 16 Sep 2011 Link to this post

    After adding the new EnableCheckAllItemsCheckBox, when checking the box the OnItemChecked is not fired. For all othe check boxes in the list it is.
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 17 Sep 2011 Link to this post


    sorry by mistake

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 17 Sep 2011 Link to this post

    Hello Ken,

    Your observation is correct - ItemChecked event fires when one item is checked.

    When user checks the "Check All" checkbox - all RadComboBox items are marked as checked and added to control CheckedItems collection.  So the simplest approach that you can use is to add an ordinary ASP.NET Button to fire a postback and get these checked items at server-side.
    You can see this approach demonstrated here.

    In general the idea to add some kind of "checked" server event to "Check All" checkbox is good, and we will consider it for future releases.

    Regards,
    Kalina
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
  5. Phuc
    Phuc avatar
    47 posts
    Member since:
    Aug 2011

    Posted 19 Sep 2011 Link to this post

    Hello Kalina,

    "Check All" checkbox event should be distinguished from event of other items for filtering data in code behind.
    For example : In my case, when "All" item is checked, data of another Combobox will be refreshed ... So I cannot apply this Comboboxfor my case now.

    Regards,
    Phuc
  6. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 21 Sep 2011 Link to this post

    Hello Phuc,

    I suppose that I haven't been precise enough in my previous post.
    The ItemChecked event rises when an item checkbox is checked.
    Of course when the CheckAll checkbox is checked - a different event will be fired.

    All the best,
    Kalina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  7. Phuc
    Phuc avatar
    47 posts
    Member since:
    Aug 2011

    Posted 22 Sep 2011 Link to this post

    Thanks Kalina,
    I'll try it

    Regards,
    Phuc
  8. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 14 Feb 2012 Link to this post

    Is there likely to be any progress on this?

    I really don't want to have to use a separate control just to force a postback if the user clicks on the Check All option.

    Can anyone think of a workaround?

    --
    Stuart
  9. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 14 Feb 2012 Link to this post

    > Can anyone think of a workaround?
    Hmmm, as the client Checked event doesn't fire either, maybe not.

    --
    Stuart
  10. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 14 Feb 2012 Link to this post

    Hello Stuart Hemming,

    I am afraid that this issue is not addressed yet, but I can provide you a workaround.

    Please try attaching a change() event handler at CheckAllItemsCheckbox in this way:
    <title></title>
    <script type="text/javascript" language="javascript">
    function onLoad(sender) {
        $telerik.$('.rcbCheckAllItemsCheckBox').change(function() {       
         __doPostBack();
                          
        });
    }
        
    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <telerik:RadComboBox ID="RadComboBox1" runat="server"
                AutoPostBack="true" OnItemChecked="RadComboBox1_ItemChecked"
                CheckBoxes="true"  OnClientLoad="onLoad"
                EnableCheckAllItemsCheckBox="true" >
                <Items>
                    <telerik:RadComboBoxItem Text="item 1" Value="1" />
                    <telerik:RadComboBoxItem Text="item 2" Value="2" />
                    <telerik:RadComboBoxItem Text="item 3" Value="3" />
                </Items>
            </telerik:RadComboBox>
            <asp:Label ID="lblPostBack" runat="server"></asp:Label>
        
        </div>
        </form>

    protected void Page_Load(object sender, EventArgs e)
    {
        lblPostBack.Text = this.RadComboBox1.Text;
    }
        
    protected void RadComboBox1_ItemChecked(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)
    {
        lblPostBack.Text = this.RadComboBox1.Text;
    }


    Greetings,
    Kalina
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  11. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 14 Feb 2012 Link to this post

    Kalina,

    Thanks for the input.

    Sadly, the workaround is of limited utility if there is more than one combobox on the page.

    Now, if it were possible to get hold of the necessary details to allow the call to __doPostBack to be targetted correctly...

    --
    Stuart
  12. Yeroon
    Yeroon avatar
    87 posts
    Member since:
    Oct 2012

    Posted 15 Feb 2012 Link to this post

    Since I also use multiple combo's and need this functionality I resolved it by adding hidden submitbuttons for each combo and let each checkall check trigger the corresponding click event of the button instead of a full __doPostback

    This way you know what combo triggered this action.

    Any new on this functionality (server and clientside event on CheckAll) being part of the Q1 2012 release?

    /Yeroon
  13. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 17 Feb 2012 Link to this post

    Hello,

    Adding server and client-side events to the "CheckAll" section is already a part of our future plans for the CheckBoxes feature. I will update this thread when the improvement is ready.

    Meanwhile you can try attaching the change() event hander in this way:
    <head runat="server">
    <title></title>
        <script type="text/javascript" language="javascript"  >
        function pageLoad()
        {
                   
            var combos = Telerik.Web.UI.RadComboBox.ComboBoxes;
     
                if (combos != null)
                {
                    for (var i = 0; i < combos.length; i++)
                    {
                        var combo = combos[i];                       
                        var element = combo.get_dropDownElement();
                        var checkAll = $telerik.$(element).find(".rcbCheckAllItemsCheckBox");
                           
                        checkAll.change(function() {  
                            alert(combo._uniqueId);
                            __doPostBack();                  
                        });
      
                    }
                }
            }
             
    </script>
     
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
              <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
     
             <telerik:RadComboBox ID="RadComboBox1" runat="server"
                CheckBoxes="true" 
                EnableCheckAllItemsCheckBox="true" >
                <Items>
                    <telerik:RadComboBoxItem Text="item 1" Value="1" />
                    <telerik:RadComboBoxItem Text="item 2" Value="2" />
                    <telerik:RadComboBoxItem Text="item 3" Value="3" />
                </Items>
            </telerik:RadComboBox>
     
     
             <telerik:RadComboBox ID="RadComboBox2" runat="server"
     
                CheckBoxes="true"
                EnableCheckAllItemsCheckBox="true" >
                <Items>
                    <telerik:RadComboBoxItem Text="item 1" Value="1" />
                    <telerik:RadComboBoxItem Text="item 2" Value="2" />
                    <telerik:RadComboBoxItem Text="item 3" Value="3" />
                </Items>
            </telerik:RadComboBox>
     
        </div>
        </form>
    </body>


    All the best,
    Kalina
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  14. Moon
    Moon avatar
    249 posts
    Member since:
    Oct 2012

    Posted 30 Apr 2013 Link to this post

    What's the status of this? It's more than a year later and it's still not allowing a checkall event.
  15. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 02 May 2013 Link to this post

    Hi All,

    I've added an item to the feedback portal for this as this seems to be the preferred method for recording feature requests and bugs.

    Why not go and add a vote for it and see if we can get this missing functionality included in the core product?
  16. Milad Doraki
    Milad Doraki avatar
    3 posts
    Member since:
    Jul 2013

    Posted 22 Jul 2013 Link to this post

     

    Hello,everybody.suggest me is for you :

     

     

     

    <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
    <script type="text/javascript">
     
    function onLoad(sender, arg) {
     
     $telerik.$($telerik.$(sender.get_dropDownElement()).find(".rcbCheckAllItems")).find(".rcbCheckAllItemsCheckBox").change(function () {
     
        __doPostBack(sender.get_id(),'');
     
     
    });
     
    }
     
    </script>
    </telerik:RadCodeBlock>
  17. Marcos
    Marcos avatar
    5 posts
    Member since:
    Feb 2015

    Posted 24 Feb 2015 Link to this post

    Any progress on this... I think it will be a very useful feature for the combo box, since adding an extra click for the users doesn't seem the proper solution.

    I'm using the 2015 version the the combo box still behaves the same.
  18. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 27 Feb 2015 Link to this post

    Hello Marcos,

    The proper events for this action are already implemented.You can use OnCheckAllCheck (the server-side event) and the OnClientCheckAllChecked or OnClientCheckAllChecking client-side events.

    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  19. Marcos
    Marcos avatar
    5 posts
    Member since:
    Feb 2015

    Posted 13 Apr 2015 in reply to Nencho Link to this post

    Thanks!!! it worked perfectly.

     

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017