Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataGrid: Expose public info about DetailRow being expanded #5949

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tesar-tech
Copy link
Collaborator

Description

Closes #5947

This update exposes DataGridRowInfo.DetailRowExpanded, requiring several adjustments:

  • Renamed the original DataGridRowInfo:
    Changed to _DataGridRowInfo to reflect its private nature while retaining DataGridRowInfo as the publicly exposed name. Alternatives considered include RowInfo, DataGridRowInfoPublic, etc.

  • Introduced a new public DataGridRowInfo:
    This class now directly exposes DetailRowExpanded. And can be used in a future to expose more a different info.

  • Renamed HasDetailRow to DetailRowExpanded:
    As mentioned in the issue description. An alternative like DetailRowVisible is possible, given the existing DetailRowStartsVisible, but Expanded feels better. It might also be worth renaming DetailRowStartsVisible to DetailRowStartsExpanded for consistency..

  • Renamed GetRowInfo to GetRowInfoPrivate:
    This change allows GetRowInfo to be used as the public method.

Merged 1.7, as it required a sample and a functional gh action for testing.

@tesar-tech tesar-tech requested a review from stsrki January 22, 2025 13:38
@stsrki
Copy link
Collaborator

stsrki commented Jan 22, 2025

I think something is not right with the PR. Too many files is changed. Have you used the wrong target branch?

@tesar-tech
Copy link
Collaborator Author

I think something is not right with the PR. Too many files is changed. Have you used the wrong target branch?

That's because I merged the 1.7 to this branch, because I needed the code example.

If you merge 1.7 to master the extra code won't be part of this pr anymore.

@@ -414,7 +414,7 @@ public bool RemoveColumn( DataGridColumn<TItem> column )
/// Links the child row with this datagrid.
/// </summary>
/// <param name="row">Row to remove.</param>
public bool RemoveRow( DataGridRowInfo<TItem> row )
public bool RemoveRow( _DataGridRowInfo<TItem> row )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense to mix public API and private APIs. In this case we have public methods that are working with our "private" models.

I would leave it as previously, as DataGridRowInfo. And then make some fields as internal. If possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change comes form the rename of DataGridRowInfo to _DataGridRowInfo.
There is no change in functionality or accessibility or class usage

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no change in functionality or accessibility or class usage

True, but it is still a breaking change. And now we have a private named class publicly exposed.

Revert to the original name, as we don't want this kind if naming for our API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I reverted back and renamed created the DataGridRowPublicInfo ...
I still don't quite understand the conventions here and the public/private/internal logic behind this.

Why are some members marked public, while used only for internal stuff? Why are some of those named with _ prefix and some are not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataGrid: add API that tells us if detail row is expanded or present
2 participants