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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:05:06+00:00 2026-05-27T22:05:06+00:00

I have a custom GridView like control made of a Grid panel with several

  • 0

I have a custom GridView like control made of a Grid panel with several controls in each row (All of them from System.Windows.Controls).

The user requested that the row Height will grow unrestricted with the control’s content. I’m having a problem to maintain the size of all the controls in each row with relation to the highest one.

I’m trying to one-way bind the Height of all the controls in each row to the RowDefenition ActualHeight property. but it is not working as I expect it to work (Each control keeps it’s own size to the minimum)

Any help will be appreciated, thanks.

Here is the code where I’m trying to bind:

                RowDefinition rowDef = new RowDefinition();

                cellsGrid.RowDefinitions.Add(rowDef);
                rowDef.Name = "gvRow" + cellsGrid.RowDefinitions.Count;

                cellsGrid.Children.Add(controlToAdd);
                Grid.SetRow(controlToAdd, rowIndex);
                Grid.SetColumn(controlToAdd, columnIndex);

                Binding bindH = new Binding("ActualHeight");
                bindH.Mode = BindingMode.OneWay;
                bindH.Source = rowDef;
                BindingOperations.SetBinding(controlToAdd,RowDefinition.HeightProperty, bindH);

                controlToAdd.TabIndex = (totalTabIndex + 1); totalTabIndex++;
                cell.CellElement = controlToAdd;
                cell.EndEdit += new GridViewCell.GridViewEditHandler(cell_EndEdit);
  • 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-27T22:05:07+00:00Added an answer on May 27, 2026 at 10:05 pm

    Try setting your Control’s VerticalAlignment to Stretch, so it expands to fill all available space.

    Also, I don’t think RowDefinition has an ActualHeight property, so the binding is probably evaluating to nothing. You’d need to bind to the ActualHeight of your control, however that value isn’t know until after it’s been Rendered. I suppose you could use Dispatcher.Invoke to run something after the controls have been rendered, figure out which is the tallest control in the row, and set all item to be that height.

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

Sidebar

Related Questions

I have a GridView in which each row has a custom view. The grid
I have come across the ASP.NET ready made controls like grid, repeater... etc. For
I have a few aspx pages which displays GridView controls. In each control I
I have a custom control that is derived from ListView . This list view
I have custom upload control. The control has gridview with the uploaded documents and
I have followed Custom Pagination article to implement the custom pagination using GridView. I
I have the GridView below. I am binding to a custom datasource in the
I have custom coded several enterprise applications for mid to large organizations to use
Here's what I have: Custom-made C# CMS where the content is stored in a
I've got a GridView control which is bound to a List of custom objects.

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.