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 1007127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:34:13+00:00 2026-05-16T08:34:13+00:00

I have a TextBox and a DropDown inside a ListView which is binded to

  • 0

I have a TextBox and a DropDown inside a ListView which is binded to a viewModel.
While comboBox is working fine, i am not able to “enter” any text inside the TextBox. Backspace/SpaceBar/Ctrl+C/Ctrl+V are working just fine, but as soon as i press any alphanumeric key, it doesn;t shows any text in the TextBox.

Have also checked using empty KeyUp/KeyDown/TextChange event handler. It raises KeyUp/KeyDown event for all type of key press but TextChange is not triggered on pressing any alphanumeric key.

Please suggest if anyone has faced this problem ever. Or if there is a way to debug and find the actual problem.

This is my XAML – nothing in code behind.

<Window x:Class="Ion.MarketView.Mmi.Plugins.AlertConfigurator.View.AlertConditionItemViewDebug"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             x:Name="aletConditionItems"
             mc:Ignorable="d" >
        <Grid >
            <Grid.Resources>
                <Style TargetType="ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                    <Setter Property="VerticalContentAlignment" Value="Stretch" />
                </Style>
            </Grid.Resources>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="75"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <ListView Grid.Column="0" x:Name="lstViewConditionItems"                     
                     ItemsSource="{Binding ElementName=aletConditionItems, Path=DataContext.Items}"                          
                     SelectedItem="{Binding ElementName=aletConditionItems, Path=DataContext.SelectedItem, Mode=TwoWay}">
                <ListView.View>
                    <GridView>
                    <GridViewColumn Header="Column Id" >
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <ComboBox SelectedValue="{Binding Path=ColumnId}" Margin="-6,-2,-6,-2"                
                    ItemsSource="{Binding ElementName=aletConditionItems, Path=DataContext.ColumnIds}" />
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                    </GridViewColumn>

                        <GridViewColumn Header="Value" Width="100" >
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBox Text="Only backSpace and SpaceBar works" ></TextBox>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>


                    </GridView>
                </ListView.View>
            </ListView>

            <StackPanel Orientation="Horizontal" Grid.Column="1" VerticalAlignment="Top" >
                <Button Content="+" Width="30" Command="{Binding ElementName=aletConditionItems, Path=DataContext.OnAddConditionItem}"></Button>
            </StackPanel>
        </Grid>
    </Window>

Thanks for your interest.

Note:
1) I am loading this WPF window from a WinForm application.

2) The problem is NOT in the binding of textBox with viewModel. I am not even able to edit a simple text that is hardcoded in the Text property (as in the code above)

3) I have not registered “any” event handler in any parent control.

Solution:
As per the links suggested by @HCL, the following code fixed my problem.

Window window1 = new Window();

ElementHost.EnableModelessKeyboardInterop(window1); //This is needed for Sharing Message Loops Between Win32 and WPF 

window1.Show();
  • 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-16T08:34:14+00:00Added an answer on May 16, 2026 at 8:34 am

    I’ve seen such a behaviour if a wpf-window integrated into a win-forms-application. Make a comment if it’s this.

    If not, check if you have registered a PreviewKeyDown-event handler in a parent-element (window, usercontrol, grid) that sets the e.Handled-property to true (or any other registered preview-event-handler that deals with keyboard-input).

    Because you wrote that copy-paste and space works, I assume that you not have set TextBox.IsReadOnly in a parent-element or a style or control-template of a parent-element or of an implicit style.

    One thing more: Is the line

    <TextBox Text="Only backSpace and SpaceBar works" ></TextBox>
    

    really the line that does not work or do you have a binding that not works?

    Update:

    Ok, because it’s a win-forms-application, you must redirect the messages from the win32 message-loop. Look here, here and here.

    An additonal tip: Take care on creating new windows from within an integrated WPF-window. As far as I remember from an elder project, you must also forward messages to any new child-window.

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

Sidebar

Ask A Question

Stats

  • Questions 514k
  • Answers 514k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your idea is right. The viewModel should be a view… May 16, 2026 at 6:13 pm
  • Editorial Team
    Editorial Team added an answer This smells like homework, so only a hint. You don't… May 16, 2026 at 6:13 pm
  • Editorial Team
    Editorial Team added an answer No, there isn't. Either use a semi transparent 24-bit PNG… May 16, 2026 at 6:13 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

i have one jquery ui datepicker working fine. I am now adding a second
I have controls like Textbox, dropdown on my CustomerDetails.ascx partialview. Now can we do
I have a drop-down list which gathers data from the database and a textbox
Dropdown In my site I have a set of SELECT dropdowns that are set
I have a page setup like so: <ajax:UpdatePanel id=UpdatePanel1 runat=server UpdateMode=Conditional> <ContentTemplate> <asp:TextBox id=TextBox1
I have a viewmodel class for a create view that consists of 2 properties
I've built a UserControl that extends the functionality of the ComboBox in interesting and
I have the following on my website. Source [DropDownList] Website Search Engine Other Other
I have a form that uses a JQuery Json post. I have 10+ textboxes
I'm using the JQuery DatePicker to have the user pick a date and have

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.