SpaceKey issue with TextBox in ExpanderHeader

4 posts, 0 answers
  1. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 18 Aug 2010 Link to this post

    Hello,

    I have a RadExpander with in its header a textbox. When I try to type a " " (space) inside the textbox, the expander collapses/expands. I've searched for solutions but the only one I can find is to change the template according to this post (http://www.telerik.com/community/forums/silverlight/expander/preventing-expander-to-expand-on-space-key.aspx). Unfortunately I'm unable to find the ToggleButton in the template. Maybe this is because this is a rather old post?

    I've also tried to play with the keydown/up events, but this doesn't seem to do the trick. Could someone give me any ideas? I'm not that good in changing templates, so an example would be nice.

    Thanks,
    We Sodi
  2. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 20 Aug 2010 Link to this post

    Hi Sodi We,

    Attached is a sample project where I edited the style in Blend, shrunk the header of the RadExpander and added a TextBox instead. Could you please review it and if you have questions feel free to ask?

    On a side note, I'd like to inform you that we've just released an online tool that allows you to reduce the size of your Silverlight applications. For more information, please visit http://blogs.telerik.com/blogs/posts/10-06-10/telerik_assembly_minifier.aspx

    Sincerely yours,
    Viktor Tsvetkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 20 Aug 2010 Link to this post

    I can see that you've added the TextBox to the ExpanderTemplate, but I think this isn't the right approach for me.

    I'll explain my situation in more detail. I have an ItemsControl that is bound to an observable collection of steps. For every step, I show a radexpander with in its header a textbox with the name of the step. Every step contains one or more tasks. So, in the radexpandercontent for the steps, there is another itemscontrol for the tasks. For every task a radexpander is shown, with in its header a textbox with the name of the task. Users can edit this name. Next to the name textbox for the step there are four buttons: add task, remove step, and move step up or down. Next to the name textbox for the task there is one button: remove task.

    In the sample application you've provided, there is a "hardcoded" textbox in the style. I'm not sure on how to bind the stepname to the text property of this textbox? Do I have to inherit from the RadExpander and add an extra DependencyProperty for the name? And if I want the buttons to be displayed as well, then I would have to have an extra "container" somewhere in the Style as well, and the dependency property in the inherited class? For me it would be enough if there was just a way to disable the spacekey for the radexpanderheader...

    This seems like a lot of work, and I'm not familiar with the best approach on how to extend Telerik Controls this way. So any help is much appreciated.

    Thanks,
    Sodi We
  5. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 20 Aug 2010 Link to this post

    Hi Sodi We,

    As soon as you have to bind the TextBox, you can set  Text="{TemplateBinding Tag}" and in the RadExpander to bind Tag="{Binding Name}". About the buttons next to the TextBox you can just organize your layout to look like that instead of adding them in the style of the RadExpander.

    Regards,
    Viktor Tsvetkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top