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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:10:16+00:00 2026-06-03T00:10:16+00:00

I have a DataGrid with a ComboBox in a DataTemplate <DataGridTemplateColumn Header=Stock Name Width=290>

  • 0

I have a DataGrid with a ComboBox in a DataTemplate

<DataGridTemplateColumn Header="Stock Name" Width="290">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding StockName}"/>
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    <DataGridTemplateColumn.CellEditingTemplate>
        <DataTemplate>
            <ComboBox Width="290" Name="cmbStock" ItemsSource="{Binding Path=Stocks}" FocusManager.FocusedElement="{Binding RelativeSource={RelativeSource Self}}" ></ComboBox>
        </DataTemplate>
    </DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>

I want the ComboBox to DropDownOpen when i reach this DataGridCell using Tab
This include in making the DataGrid Cell in edit mode when i reach it.

I am using WPF MVVM

  • 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-06-03T00:10:17+00:00Added an answer on June 3, 2026 at 12:10 am

    I think what you need to do is to force the data grid into “single-click or tab” edit mode. Basically when the cell is focused force the grid to swtich the CellTemplate to CellEditingTemplate. The code for that is:

    BeginEdit(); //dataGrid.BeginEdit()
    

    Now how and where you hook that up depends on how much work you want to do. You could extend the DataGrid class and introduce DependencyProperty “SingleClickEdit” or whatever you wanna call it. Then when monitor/preview key down and on tab select the cell and force it to be in edit mode. Or if you need it just for that column, you could just monitor:

    <TextBlock Text="{Binding StockName}" 
               GotFocus="OnGotFocus" 
               PreviewKeyDown="OnPreviewKeyDown"
      ....., or something like that
    

    Then in .cs code, in OnGotFocus() for example, call datagrid.BeginEdit().

    EDIT:(per comments/converation below)

    • add SelectionChanged handler to your datagrid
    • add IsDropDownOpen = true to your combobox

      <DataGrid x:Name="dataGrid" 
             SelectionChanged="dataGrid_SelectionChanged"
             ....>
      
      <ComboBox Width="290" Name="cmbStock" ItemsSource="{Binding Path=Stocks}" 
            ...
            IsDropDownOpen="True"></ComboBox>
      </DataTemplate>
      
    • in .cs

      private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
      {
          dataGrid.BeginEdit();
      }
      

    That should do it, work in my test :), basically you’re forcing the datagrid into edit mode on selection, and in your edit mode, you got the combobox that is already open

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

Sidebar

Related Questions

I can add a Combobox to a DataGrid using following xmal: <local:DataGridTemplateColumn Header=SomeHeader Width=106
I have next XAML <ComboBox Margin=5 Width=150 Name=languageComboBox> <ComboBoxItem Content=Russian Tag =1 IsSelected=True/> <ComboBoxItem
I have a DataGrid which is as follows:: <wpfkit:DataGrid AutoGenerateColumns=False ItemsSource={Binding} Width=Auto FrozenColumnCount=2 SelectionMode=Extended
I have a datagrid with a column of comboboxes defined like this: <DataGridTemplateColumn x:Name=AssortmentQualitySettingsDataGridColumn
I have a WPF toolkit DataGrid as the dropdown in a ComboBox template. <toolkit:DataGrid
I have a datagrid called DataGridView1, column A contains a name, column B contains
I have a datagrid where some of the text needs to span multiple columns.
I have a DataGrid in WPF app with several columns, including a Name column.
I have a DataGrid which I am binding to a PagedCollectionView which is grouped
I have a combobox inside of my WPF DataGrid. It is created like this:

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.