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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:30:17+00:00 2026-06-14T04:30:17+00:00

I have a one column grid, with rows of varying heights in a WPF

  • 0

I have a one column grid, with rows of varying heights in a WPF application. The items in the grid are dynamically generated, and will be added and removed at run-time.

For each row that is added, I would like a GridSplitter row to be inserted between each element.

I currently bind the model data via an ItemControl, and use AttachedProperties to obtain the element row count (obviously the eventual solution will have a higher number of rows to include the GridSplitters):

<ItemsControl ItemsSource="{Binding MyModel}">
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <Grid local:GridHelpers.RowCount="{Binding MyModel.RowCount}" local:GridHelpers.ColumnCount="1"/>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
</ItemsControl>

The MyModel variable is an ObservableCollection which contains ViewModel objects. The RowCount is a member variable which returns the number of elements in the collection.

How can I insert a GridSplitter between each of the rows?

I would like each element and GridSplitter to be generated from a template. However, if the GridSplitter is contained within a template, it doesn’t work due to the presence of a ContentPresenter as its parent rather than a Grid. I’m running out of ideas, apart from creating my own UI element which has its own splitter component written from scratch. There must be an other way surely!

Many thanks for your help.

  • 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-14T04:30:18+00:00Added an answer on June 14, 2026 at 4:30 am

    Well, after a considerable amount of reading, I think I have found the best solution, for those who may wish to do the same thing.

    I implemented something similar to how the ColumnResizerAdorner works in the core WPF library. It may also be worth looking at the ResizingAdorner example in MSDN’s WPF sample.

    I have a class for the adorning, which adds a Thumb to a VisualCollection. A class for handling thumb dragging events. This class is aware of the Grid row definitions, and resizes them accordingly.

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

Sidebar

Related Questions

I have one column matrix with n rows. I want difference between row 2
am using the application in this link http://www.jeasyui.com/tutorial/app/crud2.php .I have added one more column
I have a WIndows Forms Application. I needed a DataGridView so i added one.
I have a relatively complex layout. It consists of: A grid with one column
I have a Grid which contains an Image in one of its columns. The
by default I have one column in MySQL table to be NULL. I want
I would like to have one column in QTableWidget NOT editable. In forums I
I have one sqlserver 2008 r2 datatable, it has one column autoId int identity(1,1),
I have some tables. These tables all have one column in common called 'classified_id':
I need to disable slickgrid horizontal scrollbar. I have only one column and have

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.