Cancel RadListBox client click event

4 posts, 0 answers
  1. guillaume.lebel
    guillaume.lebel avatar
    60 posts
    Member since:
    Oct 2012

    Posted 18 Oct 2010 Link to this post

    Hi,

    I have a listbox with different items that display different elements in my page when i click on it. But if the user has modified anything in the page i'm calling a confirm window to be sure the user want to change his current selected item without saving the change.

    The thing is i'm using OnClientSelectedIndexChanged and it still doing a post back even if i have call args.set_cancel(true).

    Is there a way to cancel the client click without doing a post back in my page???

    Thx for your help,

    Guillaume
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 18 Oct 2010 Link to this post

    Move your code to OnClientSelectedIndexChanging, since you can only cancel the event there.

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. guillaume.lebel
    guillaume.lebel avatar
    60 posts
    Member since:
    Oct 2012

    Posted 19 Oct 2010 Link to this post

    Hi thx for your quick answer,

    I just made i mistake in my previous message, i'm already using the OnClientSelectedIndexChanging. Sorry about that.

    What i was saying, is that the event seems to not being cancel (args.set_cancel(true)) and it still doing the postback if i cancel  the selectedindexchanging event.

    Again thx for your help,

    Guillaume
  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 22 Oct 2010 Link to this post

    Hello guillaume.lebel,

    Please consider removing the AutoPostBack = true declaration from RadListBox should posting back to the server is not desired. The set_cancel property in the SelectedIndexChanging event args serves for canceling the selection of the given item, not for preventing a postback. However, it indeed makes sense that canceling the selectionIndexChanging should not postback the page. We will research what side effects might such change have to RadListBox.

    Sincerely yours,
    Genady Sergeev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top