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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:53:45+00:00 2026-06-04T01:53:45+00:00

I have requirement to keep datagridcell always in edit mode. I dont find any

  • 0

I have requirement to keep datagridcell always in edit mode. I dont find any option to make datagrid cell edit mode so I took TextBox under datagrid cell using control template.

I am able to write in text box but datagrid cell content never get updated. How I can update datagrid cell content with whatever I write in textbox ? Here is style :

    <Style TargetType="{x:Type DataGridCell}" x:Key="DatagridCellWithTextbox">
            <Setter Property="BorderThickness" Value="2"></Setter>
            <Setter Property="Foreground" Value="{DynamicResource ContentNormalBrush}"/>
            <Setter Property="Margin" Value="0"></Setter>
            <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                        <Grid Background="{TemplateBinding Background}">
                          <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <TextBox x:Name="txtCell" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}" VerticalContentAlignment="Top" Focusable="True" />
                          </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
          </Style>

Thanks
Dee

  • 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-04T01:53:46+00:00Added an answer on June 4, 2026 at 1:53 am

    Have you tried DataGridCell.IsEditing Property?

    <Style TargetType="{x:Type DataGridCell}">
        <Setter Property="IsEditing" Value="True" />
    </Style>
    

    Edit:

    You can keep in edit mode setting Cancel property in DataGrid.CellEditEnding Event to True.

    <DataGrid CellEditEnding="DataGrid_CellEditEnding"
    

    .

    private void DataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
    {
        e.Cancel = true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a requirement to keep the RavenDB database running when the disk for
I have a requirement to keep a history of values of some fields in
I have a requirement to (very) quickly process strings of a limited range, tallying
We use Fitnesse [FitSharp] and we have a requirement for a single fit test
If you have a complex requirement set with many users(&servers) how will your websocket
my layout's requirement is to keep all thumbnails at 80px height, not higher, not
I'm creating three threads in one of my application. The requirement I have is
Long story coming up, but I'll try to keep it brief. I have many
I am working on my first NHibernate project, and have the following setup/requirement. I
I have a requirement to run a transform on a xml file. it is

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.