Hi Team,
I would like to have an external column chooser for the DataGrid. Where that chooser would be populated with the possible columns, and the user would elect/deselect what columns they want in the DataGrid.
Thank you,
Clint
.Net Maui Data Grid Property Aggregator Descriptor incorrect placement on Mac
Provide an option to sort the template column by nested property.
For example:
<dataGrid:DataGridTemplateColumn>
<dataGrid:DataGridTemplateColumn.CellContentTemplate>
<DataTemplate>
<Label Text="{Binding MyAddress.City}" />
</DataTemplate>
</dataGrid:DataGridTemplateColumn.CellContentTemplate>
<dataGrid:DataGridTemplateColumn.SortDescriptor>
<dataGrid:PropertySortDescriptor PropertyName="MyAddress.City" />
</dataGrid:DataGridTemplateColumn.SortDescriptor>
</dataGrid:DataGridTemplateColumn>
private void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
this.dataGrid.CommandService.ExecuteCommand(DataGridCommandId.CommitEdit, new EditContext(null, ActionTrigger.Programmatic, null));
}
We’ve encountered an issue related to the inner DataGrid within an outer DataGrid’s RowDetailsTemplate:
Steps to reproduce:
1. Create a DataGrid with editable cells and row details.
2. Inside the RowDetailsTemplate, place a layout (e.g., Grid).
3. Within this layout, embed another DataGrid with editable cells.
4. Start the application and expand row details on the Android platform.
5. Double-tap on any inner DataGrid's cell to open the cell editor.
At this moment the UI appears unresponsive.
Hi Team,
I have attached a reproducible. Open DashboardView.xaml, there you'll find the DataGrid.
Run the project on Windows and take the following steps:
The only way I could get it to render again was by resizing the app window, even calling InvalidateMeasure(SizeChanged) didn't work.
The logic is simple, the button click just clears MainPage.xaml's container children and adds a new instance of DashboardView:
private void OnButton1Clicked(object sender, EventArgs e)
{
currentContentViewHolder.Children.Clear();
currentContentViewHolder.Children.Add(new DashboardView());
}
DataGrid is added inside pages that can be accessed through shell flyout menu.
And the exact steps to reproduce the issue:
Go to page GridOne page in flyout menu.If I use the CellEditTemplate to show a custom view when editing - the view does not get auto focus when shown and the end user needs to tap inside so the view gets focus.
<telerik:DataGridTextColumn PropertyName="CountryName" HeaderText="Country">
<telerik:DataGridTextColumn.CellEditTemplate>
<DataTemplate>
<telerik:RadEntry Text="{Binding Item.CountryName}" />
</DataTemplate>
</telerik:DataGridTextColumn.CellEditTemplate>
</telerik:DataGridTextColumn>
Work-around:
Manually invoke the Focus() method and set the cursor position when the view gets loaded and when it changes its visibility:
<telerik:RadEntry Text="{Binding Item.CountryName}"
Loaded="RadEntry_Loaded"
PropertyChanged="RadEntry_PropertyChanged" />
private void RadEntry_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(View.IsVisible))
{
RadEntry entry = (RadEntry)sender;
if (entry.IsVisible)
{
FocusEntry(entry);
}
}
}
private void RadEntry_Loaded(object sender, EventArgs e)
{
FocusEntry((RadEntry)sender);
}
private static void FocusEntry(RadEntry entry)
{
entry.Dispatcher.DispatchDelayed(TimeSpan.FromMilliseconds(1), () =>
{
entry.Focus();
entry.CursorPosition = entry.Text?.Length ?? 0;
});
}
Add FontAutoScalingEnabled property to the header, textcell, groupheader, where font size can be set.
for the Label there is such property https://learn.microsoft.com/en-us/dotnet/maui/user-interface/fonts?view=net-maui-8.0#disable-font-auto-scaling that allows you to disable the text scaling