Suggestion: Add new buttons?

9 posts, 1 answers
  1. Nathan J Pledger
    Nathan J Pledger avatar
    95 posts
    Member since:
    Apr 2006

    Posted 10 Jul 2009 Link to this post

    Hi,

    This control is actually a control I have wanted for a while. I use the WinForms ListView control a lot which provides a lightweight but pretty useful control; this seems to map qiute well to the ListView, without requiring the weight of a grid.

    I have a question which may be a suggestion. Is it possible to add my own buttons alongside the Move Up/Down/Delete buttons? One of my items in my list needs to be set to "default". This would ideally be via a button within the listbox control itself, complemented by a styled entry - eg. in bold.

    Is this possible?
  2. Answer
    Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 10 Jul 2009 Link to this post

    Hi Nathan J Pledger,

    This is possible, you can create new button that replicates the default ones, and insert it in the table that holds the buttons of the RadListBox.

    I have prepared a demo for you, where the approach is demonstrated. As you will see, there are 3 buttons in the demo, the first 2 are default buttons - the reorder ones. The third is a custom button with very much the same look, the only difference is that he don't have the background arrow image. When you click on the custom button an alert pops up (you can implement your logic instead). Is this what you are targeting?

    Best wishes,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nathan J Pledger
    Nathan J Pledger avatar
    95 posts
    Member since:
    Apr 2006

    Posted 10 Jul 2009 Link to this post

    Hi Genady,

    Thanks a lot for your help.

    This looks like what I'm after. I'll have a play and get back to you if I have any problems.
  5. Aurore
    Aurore avatar
    58 posts
    Member since:
    Nov 2007

    Posted 18 Dec 2009 Link to this post

    Hello,

    That's great !

    But I don't understand how personnalized this button with my personnalized text or better with my icon.

    Thank you for your work

    Aurore
  6. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 21 Dec 2009 Link to this post

    Hi Aurore,

    Adding button that does not have the layout of the other buttons is as easy as appending it to the tablerow that holds the rest of the buttons. I have attached a sample project that demonstrates the approach. Please, have in mind that the background image that you are going to use must have the same size as the image of the rest buttons. Otherwise, the rest buttons are going to be stretch.

    Kind regards,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Brinda
    Brinda avatar
    9 posts
    Member since:
    Dec 2010

    Posted 08 Apr 2011 Link to this post

    Hi,

    Thanks for the custom button code.but if i want to perform a postback event what could me done? can you provide me a sample code.


    Thanks
  8. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 15 Apr 2011 Link to this post

    Hi Brinda,

    What do you mean by perform a postback event? Do you want to simply postback the page or fire specific server-side event?

    Greetings,
    Genady Sergeev
    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.

  9. Christian
    Christian avatar
    15 posts
    Member since:
    Aug 2011

    Posted 23 Sep 2011 Link to this post

    Hi Genady,

    I used your solution provided here to add a custom button to a listbox. I managed to get the button behaving as desired. Unfortunately a secondary bug has arrived as a result of the JavaScript in this demo.

    I am using this listbox within the context of a tabstrip. The visibility of the listbox is set depending on which tab is selected. My implementation works fine... but only for one tab change. A typical sequence of events is as follows:

    - Refresh the page: tab defaults to first in the row, the listbox is hidden (as it should be)
    - Click on another tab: view changes to that tab, listbox is either visible or hidden, depending on the tab logic (i.e. this works as it should)
    - Change tab again: the page hangs, showing the loading icon. The view update never completes.

    Refreshing the page will reset this sequence of events.

    Clearly editing the listbox UI directly via JavaScript is confusing the tabstrip - can you think of why this might be, and/or whether there is a solution?

    Cheers
  10. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 29 Sep 2011 Link to this post

    Hi Christian,

    I've tried reproducing the problem on a sample project, unfortunately no avail. I didn't have any trouble switching the tabs. Therefore, I suppose the problem is due to some specific in your scenario. For that matter, could you please open a support ticket and attach there your page so that we can test it on our side. Alternatively, a live URL could do as well.

    Kind regards,
    Genady Sergeev
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017