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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:17:21+00:00 2026-05-24T11:17:21+00:00

I am new to wpf and working on an accounting application. My problem is

  • 0

I am new to wpf and working on an accounting application. My problem is so simple yet I am astonished that I can not find a simplistic solution for this, it goes like this:

I have to create a datagrid in which only columns should have visible borders.

I mean it should look something like this:

 ____________________
 | col1 | col2| col3|
 |______|_____|_____|
 |   r1 |  r1 |  r1 |
 |   r3 |  r2 |  r2 |
 |      |     |     |
 |      |     |     |
 |      |     |     |
 |      |     |     |
 |______|_____|_____|

I can draw a grid without the borders at bottom but the problem is in that if there is only one row in the datagrid the column borders will not go down till the outer border of datagrid I mean if there is only one row that’s how my datagrid looks:

  ____________________
 | col1 | col2| col3|
 |______|_____|_____|
 |   r1 |  r1 |  r1 |
 |   r3 |  r2 |  r2 |
 |______|_____|_____|
 |                  |
 |                  |
 |                  |
 |__________________|

which is simple to understand because there is only one row, but what I want is irrespective of the number of rows there should be lines touching to the bottom border of the datagrid, Is there any simple way tot his??

One more problem with it is I want the first row to be selected and focused whenever the form is loaded but no matter how hard I try…it remains unresolved…

  • 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-24T11:17:23+00:00Added an answer on May 24, 2026 at 11:17 am

    One way could be to get the last row of DataGrid using this post and set it’s height to

    height = DataGridHeight - Height of all rows except last one

    You may also need to subtract value like DataGridHeaderHeight.

    About your second problem.. have you tried setting SelectedIndex of DataGrid to 0 inside loaded event of DataGrid?

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

Sidebar

Related Questions

I am new to wpf and i am working on first application i have
I am new to WPF and MVVM, and I am working on an application
While designing a new WPF application I noticed exceptions not being thrown during data
Kind of new to WPF and I am working on an app that has
I'm working on a new WPF application and I'm trying to stay as close
I'm currently working on a WPF application that uses MVVM. I've got a ListBox
I'm working on a new C# application using WPF. I was under the impression
I am working on a new WPF application.. and I need to show a
I'm relatively new to the WPF world and I'm working on an application where
I am working with WPF application in that case I am using Google API

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.