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

  • Home
  • SEARCH
  • 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 7856793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:49:14+00:00 2026-06-02T20:49:14+00:00

I am having problem with DataGrid navigation using arrow keys when my DataGrid is

  • 0

I am having problem with DataGrid navigation using arrow keys when my DataGrid is displayed initially. Up/down keys do not change the current row. Only after I click on a row do the keys start working. Has something to do with the focus, but I do not know how to set focus programmatically.

<DataGrid ItemsSource="{Binding Tasks}"
              AutoGenerateColumns="False"
              SelectedItem="{Binding SelectedTask, Mode=TwoWay}"
              SelectionMode="Single">
      <DataGrid.Columns>
        <DataGridTextColumn Header="Title"
                            Binding="{Binding Title}" />
      </DataGrid.Columns>
</DataGrid>

class MainViewModel : ModelBase
{
    private readonly ObservableCollection<TaskModel> tasks = new ObservableCollection<TaskModel>();
    public MainViewModel()
        : base()
    {
        this.Tasks.Add(new TaskModel("task0"));
        this.Tasks.Add(new TaskModel("task1"));
        this.Tasks.Add(new TaskModel("task2"));
        this.SelectedTask = this.Tasks[0];
    }<br>
    public TaskModel SelectedTask { get; set; }
    public ObservableCollection<TaskModel> Tasks
    {
        get { return this.tasks; }
    }
}
  • 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-02T20:49:16+00:00Added an answer on June 2, 2026 at 8:49 pm

    to answer my own question about how to set the initial focus: http://msdn.microsoft.com/en-us/library/system.windows.input.focusmanager.focusedelement.aspx

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

Sidebar

Related Questions

I'm having a small problem. I have this grid with a column: <data:DataGrid ColumnHeaderStyle={StaticResource
Having problem with the middle Div not expanding to the width http://acs.graphicsmayhem.com/images/middiv.jpg Ok, how
I am having problem in getting reference of Ajax control extender using $find() or
I'm having problem restricting a query in mdx, using except function at where clause.
I have a listview and also a DataGrid having records with images. My problem
I'm using a Datagrid from the WPFtoolkit and am running into a problem with
I am using WPF datagrid. Data I am binding to the grid is not
I am having problem loading data into Nested datagrid. When the user clicks on
I am having some trouble with CheckBoxes in a DataGrid. The CheckBoxes are not
How do I add row data directly to a DataGrid Class? I am using

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.