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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:52:09+00:00 2026-06-07T03:52:09+00:00

I have a data grid and a grid splitter: The splitter is in the

  • 0

I have a data grid and a grid splitter:

enter image description here

The splitter is in the bottom and the data grid on the top and there is some empty space in between the two.

I think it would work fine if the grid splitter snapped into the data grid if its 24 or less units away from the data grid. Is this possible to archive?

  • 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-07T03:52:11+00:00Added an answer on June 7, 2026 at 3:52 am

    I got it to snap per data grid rows with this:

    private void GridSplitterDragCompleted(object sender, DragCompletedEventArgs e)
    {
        // We want the grid splitter to snap in grid of 24 units.
        var excess = (int) FooDataGridRowDefinition.Height.Value % 24;
    
        if (excess == 0)
            return;
    
        FooDataGridRowDefinition.Height = new GridLength(FooDataGridRowDefinition.Height.Value - excess);
    }
    

    The data grid rows are all 24 for me, I guess I could fetch them dynamically but that will do for now.

    XAML:

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" Name="FooDataGridRowDefinition" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
    
        <DataGrid Grid.Row="0" />
    
        <GridSplitter Grid.Row="1" DragCompleted="GridSplitterDragCompleted" />
    
        <Foo Grid.Row="2" />
    </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a data grid which is having two renderers. one is text box
Let’s say I have a data grid and there’s a method attached to clicking
I have binded a data grid to an array. Also, there is a button
I have a Data Grid View and some of the columns are of type
i have data-grid in my application and i want to customize my data-grid so
I have a data grid: <DataGrid x:Name=Foo ... /> I'd like to bind an
I have a Data grid with DatagridComboBoxColumn , and i want to Fire Event
We have a data grid to display member records for our clients. We recently
I am a beginner to WPF . I have a data grid for showing
When saving a new entity something strange happens... I have a data grid with

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.