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 row index #15909

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions samples/ControlCatalog/Pages/DataGridPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<TabItem Header="Grouping">
<DataGrid Name="dataGridGrouping" Margin="12">
<DataGrid.Columns>
<DataGridTextColumn Header=" " Binding="{Binding $parent[DataGridRow].Index}" Width="60" x:DataType="local:Country" />
<DataGridTextColumn Header="Country or Region" Binding="{Binding Name}" Width="6*" x:DataType="local:Country" />
<DataGridTextColumn Header="Region" Binding="{Binding Region}" Width="4*" x:DataType="local:Country" />
<DataGridTextColumn DisplayIndex="3" Header="Population" Binding="{Binding Population}" Width="3*" x:DataType="local:Country" />
Expand Down
4 changes: 2 additions & 2 deletions src/Avalonia.Controls.DataGrid/DataGridRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ internal DataGrid OwningGrid
/// <summary>
/// Index of the row
/// </summary>
internal int Index
public int Index
rabbitism marked this conversation as resolved.
Show resolved Hide resolved
{
get;
set;
internal set;
}

internal double ActualBottomGridLineHeight
Expand Down
Loading