Textbox in toolbar

2 posts, 0 answers
  1. David Ocasio
    David Ocasio avatar
    167 posts
    Member since:
    Nov 2009

    Posted 30 Jun Link to this post

    Having an issue where I have put a textbox in a toolbar.

    The textbox Text is  bound to a property of a Viewmodel but the setter does not get exercised.

    it seems as though focus is never lost from the textbox even if the next item does receive focus.

    I would have sworn I have used this setup before without issue.

    I pulled the code into a simpler project just to verify I was not crazy and it acted the same.

    if I pull the textbox out of the toolbar it works fine.

    It must be something stupid I am doing. but  i cant see it. What am I doing wrong.

    Any help would be appreciated


                <telerik:RadToolBarTray Width="400" >
                    <telerik:RadToolBar >
                        <TextBox Text="{Binding Main.Cali ,Mode=TwoWay}" Width="100" />






  2. Dinko
    Dinko avatar
    1165 posts

    Posted 03 Jul Link to this post

    Hi David,

    Thank you for the provided details.

    I have double-checked this, and the setter is called as expected. What I think you are trying to achieve is to update the bound property on every key input. In this case, you can set the UpdataSourceTrigger property of the binding to PropertyChanged.

    <telerik:RadToolBarTray VerticalAlignment="Center" Width="460" HorizontalAlignment="Center">
                    <TextBox Text="{Binding MyItem.Header,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>

    Give this approach a try and let me know how it goes.

    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top