question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Enhancement] Grid : ActualWidth for ColumnDefinition And ActualHeight properties for RowDefinition

See original GitHub issue

Description

It could be nice to have public getter of the Actual Width and Actual Height for a specific cell inside the Grid. First for now it’s not possible to know the Width and the Height of a specific Cell when GridUnitType is in Auto or Star Unit. We need to populate the cell with an empty filled View and get his Height and Width property.

By combining this with the spacing property, we will be able to know the X and Y position of unpopulated Cell inside a Grid.

Public API Changes

Actual Api :

//ColumnDefinition Class
internal double ActualWidth { get; set; }

//RowDefinition Class
internal double ActualHeight { get; set; }

Changed needed :

//ColumnDefinition Class
public double ActualWidth { get; internal set; }

//RowDefinition Class
public double ActualHeight { get; internal set; }

Intended Use-Case

It will help to locate an empty cell inside a Grid. Then beautiful and specific animation could be done with these properties.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Phenekcommented, Oct 25, 2022

Yeah sure, I mean animating it.

0reactions
WithoutAnAcecommented, Aug 8, 2023

For what it’s worth, I would really appreciate having these exposed in order to be able to bind the width of columns in a grid in the header of a collectionview to the width of columns in that collectionview itself, among other things

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Enhancement] Grid : ActualWidth and X properties for ...
We need to populate the cell with an empty filled View and get his Height and Width property. Second it's impossible to know...
Read more >
Binding to ColumnDefinition.ActualWidth returns 0
The Grid.ActualWidth property on the other hand is a dependency property and the binding will get updated as the width changes.
Read more >
RowDefinition.Height Property (System.Windows.Controls)
Gets the calculated height of a RowDefinition element, or sets the GridLength value of a row that is defined by the RowDefinition.
Read more >
FrameworkElement.MaxWidth Property (Windows.UI.Xaml)
The width of the object after layout runs is available as the ActualWidth property value. The final ActualWidth of an element might exceed...
Read more >
Scaling of image in GridControlColumn
Hi, in DxGridControl we have columns with images. If we change the width of the column the image resizes and the rowheight resizes,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found