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

Textbox in toolbar

1 Answer 256 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
David Ocasio asked on 30 Jun 2020, 01:14 PM

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" />
                </telerik:RadToolBar>
            </telerik:RadToolBarTray>

Thanks

Dave.

 

 

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 03 Jul 2020, 07:16 AM

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">
            <telerik:RadToolBar>
                <TextBox Text="{Binding MyItem.Header,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
            </telerik:RadToolBar>
           
        </telerik:RadToolBarTray>

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

Regards,
Dinko
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.
Tags
ToolBar
Asked by
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or