RadListBox - stopping an autopostback

2 posts, 0 answers
  1. Uday
    Uday avatar
    10 posts
    Member since:
    Dec 2010

    Posted 16 Feb 2012 Link to this post


    I have a RadListbox in the below fashion

    <telerik:RadListBox ID="chkTools" runat="server" CheckBoxes="True" AutoPostBack="True"
    OnItemCheck="chkTools_ItemCheck" EnableEmbeddedSkins="False" OnClientItemChecked="onItemChecked" 

    If i want to stop the post happening based on a condition which even should I use OnClientItemChecked or OnClientItemChecking and how should it be?
  2. Kate
    Kate avatar
    1898 posts

    Posted 17 Feb 2012 Link to this post

    Hello Uday,

    If you need to prevent the postback of the page (and thus preventing the onitemcheck event to fire) you will need to use the OnClientItemChecking event and the following client side function:
    <script type="text/javascript">
            function onItemChecking(sender, args) {

    Here is also the markup that I used:
    <telerik:RadListBox ID="chkTools" runat="server" CheckBoxes="True" AutoPostBack="True"
                OnClientItemChecking="onItemChecking" onitemcheck="chkTools_ItemCheck">
                <telerik:RadListBoxItem Text="item1" Value="1" />
                <telerik:RadListBoxItem Text="item2" Value="2" />
                <telerik:RadListBoxItem Text="item3" Value="3" />
                <telerik:RadListBoxItem Text="item4" Value="4" />
                <telerik:RadListBoxItem Text="item5" Value="5" />
                <telerik:RadListBoxItem Text="item6" Value="6" />
                <telerik:RadListBoxItem Text="item7" Value="7" />

    All the best,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft R3 2016 release webinar banner
Back to Top