Choosing the right control: is there a HeaderedListBox?

2 posts, 0 answers
  1. Debbie
    Debbie avatar
    15 posts
    Member since:
    Mar 2009

    Posted 04 Jun 2009 Link to this post

    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
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 05 Jun 2009 Link to this post

    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.
Back to Top