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

title in listbox

2 Answers 213 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
appdev
Top achievements
Rank 1
appdev asked on 12 Jul 2009, 11:11 AM
hey guys, i was just wondering if there's a way for us to have header for the listbox and don't allow users to select the header. and when you move item from listbox2 back to listbox1, that item goes into the right section like this

section1
    1
     2
section2
     3
     4

then say you move 1 and 3 to listbox 2, that's fine. header will stay the same, you can't move header section1 and section2. then when you move 1 and 3 back to listbox1, it will go into the correct section. if there's a way please let me know. thanks

2 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 15 Jul 2009, 01:59 PM
Hello Duy,

RadListBox does not support such Group (Header) Items out-of-the-box.

Alternatively you can use Templates (for those Header Items) to visually differentiate them from other Items. Then you can handle the client-side SelectedIndexChanging event and cancel it if a Header Item has been clicked (Header Items could have unique values, e.g. -1).

As for transferring back an Item to the source ListBox you can handle the client-side Transferred event and then reorder the Transferred Item(s) to their respective Group.

Please see the Templates demo or the related help article for more information. 

The SelectedIndexChanging event is not yet documented, still it is identical to SelectedIndexChanged with the only difference that it can be canceled (eventArgs.set_cancel(true)).

I hope this gets you started.

Greetings,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
ManniAT
Top achievements
Rank 2
answered on 20 Jul 2009, 12:07 PM
A little addition - (I have some "unmoveable" items in my boxes where I use this) you could set the "header" to Enabled="false".
Tags
ListBox
Asked by
appdev
Top achievements
Rank 1
Answers by
Simon
Telerik team
ManniAT
Top achievements
Rank 2
Share this question
or