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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:50:14+00:00 2026-06-03T03:50:14+00:00

I have a DataGrid defined as follows. When I click a cell in the

  • 0

I have a DataGrid defined as follows. When I click a cell in the DataGrid only the cell is highlighted. How can I change it so that when I click the cell the entire row is highlighted?

<DataGrid Name="fileGrid" AutoGenerateColumns="False" Height="150" Width="Auto" 
            Margin="10,10,0,0" 
            HorizontalAlignment="Left" VerticalAlignment="Top" SelectionChanged="fileGrid_SelectionChanged">
    <DataGrid.Columns>
        <DataGridTextColumn Header="Company Name" 
            x:Name="columnCompanyName" 
            Binding="{Binding Path=Customer.CompanyName}"
            IsReadOnly="True">                    
        </DataGridTextColumn>

        <DataGridTextColumn Header="Customer Surname" 
            x:Name="columnCustomerSurname" 
            Binding="{Binding Path=Customer.Surname}"
            IsReadOnly="True">
        </DataGridTextColumn>

        <DataGridTextColumn Header="Customer Address" 
            x:Name="columnAddressLine1" 
            Binding="{Binding Path=Customer.Address.Line1}"
            IsReadOnly="True">
        </DataGridTextColumn>

        <DataGridTextColumn Header="Customer City" 
            x:Name="columnCity" 
            Binding="{Binding Path=Customer.Address.City}"
            IsReadOnly="True">
        </DataGridTextColumn>

    </DataGrid.Columns>
</DataGrid>
  • 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-03T03:50:15+00:00Added an answer on June 3, 2026 at 3:50 am

    Have you tried <DataGrid SelectionMode="Single" SelectionUnit="FullRow"> ?

    But actually its the default behavior if i click a cell the entire row is highlighted

    SelectionMode doc: https://msdn.microsoft.com/en-us/library/system.windows.controls.datagridselectionmode%28v=vs.110%29.aspx

    SelectionUnit doc: https://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.selectionunit%28v=vs.110%29.aspx

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

Sidebar

Related Questions

I have a datagrid defined in XAML as follows: <toolkit:DataGrid Margin=10,116,62,34 Name=WADataGrid RowBackground=LightYellow AlternatingRowBackground=White
I have a DataGrid defined as follows as part of a UserControl: <DataGrid x:Name=dtGrid
I have defined the datagrid as follows <mx:DataGrid id=dg width=100% height=100% > In the
I have a class defined like this: class TouchScreenDisabledGrid:DataGrid,INotifyPropertyChanged I want to change soome
I have a datagrid with a column of comboboxes defined like this: <DataGridTemplateColumn x:Name=AssortmentQualitySettingsDataGridColumn
I have a DataGrid, with an ItemTemplate that has an image and label. In
I have a datagrid called DataGridView1, column A contains a name, column B contains
The situation is simple. I have a datagrid that gets its data from a
I'm really hoping someone can help me out here. I have a DataGrid in
I have a comboxbox defined like this (basically): <ComboBox x:Name=pageViewSize> <ComboBox.Items> <ComboBoxItem IsSelected=True>5</ComboBoxItem> <ComboBoxItem>10</ComboBoxItem>

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.