Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4063416
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:43:22+00:00 2026-05-20T15:43:22+00:00

I can use Interaction.Triggers to catch the textchanged event on a textbox like so:

  • 0

I can use Interaction.Triggers to catch the textchanged event on a textbox like so:

<TextBox  Text="{Binding Title}" Style="{StaticResource GridEditStyle}">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="TextChanged">
                            <cmd:EventToCommand Command="{Binding TextChanged}" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </TextBox>

However when I use it in a datatemplate for a listview celltemplate as follows:

 <ListView  ItemsSource="{Binding LangaugeCollection}" SelectedItem="{Binding SelectedLangauge}" BorderThickness="0" FontFamily="Calibri" FontSize="11">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Width="200">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate >
                                    <Grid>
                                        <TextBlock Text="{Binding Title}" Style="{StaticResource GridBlockStyle}">
                                        </TextBlock>
                                        <TextBox  Text="{Binding Title}" Style="{StaticResource GridEditStyle}">
                                            <i:Interaction.Triggers>
                                                <i:EventTrigger EventName="TextChanged">
                                                    <cmd:EventToCommand Command="{Binding TextChanged}" />
                                                </i:EventTrigger>
                                            </i:Interaction.Triggers>
                                        </TextBox>
                                    </Grid>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                    </GridView> 
                </ListView.View>
            </ListView>

the event will not trigger.

Does anyone know why this does not trigger and how to fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:43:22+00:00Added an answer on May 20, 2026 at 3:43 pm

    When you are in a DataTemplate, the DataContext might not be what you expect. Typically the DataContext in a DataTemplate is set to the item that the DataTemplate represents. If your TextChanged command is on the “main viewmodel” instead of the data item, you need to be more precise in the way that you specify the data binding, for example:

    Command=”{Binding Source={StaticResource Locator}, Path=Main.TextChanged}”

    You can see the issue when you run the code in debug mode (F5) in Studio and observe the Output window. A Data Error will be shown if the DataContext is incorrectly set.

    Cheers,
    Laurent

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very happy with my small collection of Blend behaviors, actions and triggers -
I have a scenario where I want to dynamically add words of text to
I am working on creating the necessary views, triggers and stored procedures so I
I want to be able to : define different jobs and triggers. modify the
I've hooked up a ComboBox's SelectedItemChangeEvent to a ICommand in my view model. Everything
What are good ways to handle user input concurrency? As the answers to this
Lets say that I have a drop down list that I want to create
As recently as several years ago, the developers actually made the builds that went
I'm currently working on a (rather large) pet project of mine , a Swing
Without access to git and git-submodule, I need to incorporate a shared-ip repository into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.