This is a migrated thread and some comments may be shown as answers.

Suggestion: Add new buttons?

8 Answers 225 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Nathan J Pledger
Top achievements
Rank 2
Nathan J Pledger asked on 10 Jul 2009, 08:08 AM
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?

8 Answers, 1 is accepted

Sort by
0
Accepted
Genady Sergeev
Telerik team
answered on 10 Jul 2009, 03:09 PM
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.
0
Nathan J Pledger
Top achievements
Rank 2
answered on 10 Jul 2009, 03:23 PM
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.
0
Aurore
Top achievements
Rank 1
answered on 18 Dec 2009, 11:23 AM
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
0
Genady Sergeev
Telerik team
answered on 21 Dec 2009, 03:10 PM
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.
0
Brinda
Top achievements
Rank 1
answered on 08 Apr 2011, 06:20 PM
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
0
Genady Sergeev
Telerik team
answered on 15 Apr 2011, 08:28 AM
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.

0
Christian
Top achievements
Rank 1
answered on 23 Sep 2011, 03:34 PM
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
0
Genady Sergeev
Telerik team
answered on 29 Sep 2011, 08:22 AM
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
Tags
ListBox
Asked by
Nathan J Pledger
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
Nathan J Pledger
Top achievements
Rank 2
Aurore
Top achievements
Rank 1
Brinda
Top achievements
Rank 1
Christian
Top achievements
Rank 1
Share this question
or