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

Choosing the right control: is there a HeaderedListBox?

1 Answer 57 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Debbie
Top achievements
Rank 1
Debbie asked on 04 Jun 2009, 10:10 AM
Hi Telerik team

We are building a huge Silverlight application using your controls, and we are struggling to find the correct control to use application-wide. We need some sort of itemscontrol to be used all over, with slightly different requirements, but in general these are the things the need to have in common:

  1. Itemscontrol, bindable to datasource
  2. Header (with borders between each header label and the SAME COLUMN WIDTH as the items below)
  3. Easily STYLEABLE so that the Style and "ItemStyle" can be reused/reapplied easily all over
  4. Need to be able to speciy different ItemTemplate and HeaderTemplate e.g. sometimes these could consist of 2 TextBlocks (databound) each, but sometimes it could be 5 textblocks and a checkbox etc...
  5. Multiselect - user must be able to select many items at once by clicking on them
  6. States on items - we need to be able to have mouseover and selected states on each of the items (not the Itempresenter as a whole)
  7. Ideally the user should be able to double-click on an item and fire off another event... but I think theTelerik.Windows.Input should be able to help is with implementing that on any control.

We've tried both the GridView and HeaderedItemsControl but we're finding that one is too much and one too little. Is there something half-way in between these two, e.g. a HeaderedListBox?! In my view a ListBox would be the ideal control, if you could add a Header bit onto the top and make sure that the header is somehow "pinned" to the ListBox so that if the Listbox widens, the header items widen with it.

The problem with the HeaderedItemsControl is that is it not easily styleable (i.e. you CAN style the HeaderTemplate but that happens IN the data template istelf and is therefore not easily reused on other controls by just applying a style); and I can't find a way to create the states needed per item.
The problem with the GridView is that it's "overkill" for what we need, and also we're finding it a nightmare to style to our specifications. We do have to overcome this though because we do need to use GridViews elsewhere, so I'll battle on with that in the meantime. Any updates on whether the HeaderRowStyle actually gets applied in the latest control suite update?

Please help!! Any suggestions and sample code would be greatly appreciated!

Thanks in advance, Debbie

1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 05 Jun 2009, 12:44 PM
Hello Debbie,

Unfortunately we do not provide a single control that covers all your needs, but you could create a custom control, that will fulfill all requirements. For example, you could inherit this control from ListBox and then add the needed properties (e.g. Header). In its ControlTemplate, put a ContentPresenters that is template bound to the corresponding properties (e.g. Header). As for the double click, you could either create an attached behavior (you could set the attached property through ItemContainerStyle), that handles the event on the ListBoxItem controls, or inherit a custom control from ListBoxItem and implement the same logic there.

Regarding the GridView HeaderRowStyle problem, as far as I know, it is fixed in the latest builds.

Kind regards,
Valeri Hristov
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.
Tags
General Discussions
Asked by
Debbie
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or