This demo shows Master Bulk Editing in .NET MAUI DataGrid.
Modern applications often require powerful data manipulation capabilities to handle large datasets efficiently. The Syncfusion .NET MAUI DataGrid provides advanced editing features that allow developers to create interactive, user-friendly, and high-performance data grids across Android, iOS, Windows, and macOS.
In this blog, we’ll explore Master Bulk Editing in .NET MAUI DataGrid, including bulk editing, custom editors, and validation techniques.
Bulk editing enables users to apply changes to multiple cells in a column simultaneously. For example:
- Update the status of all selected rows.
- Apply a discount to multiple products.
- Change category for a batch of items.
- Multi-Column Selection: Select multiple columns for simultaneous edits.
- Custom Editors: Use templates for specialized input fields.
- Validation Support: Ensure data integrity during bulk updates.
- Command Integration: Hook into
BeginEdit,CommitEdit, andEndEditfor controlled workflows.
<Grid RowDefinitions="Auto,*" Padding="16" Spacing="12">
<HorizontalStackLayout Spacing="12" VerticalOptions="Start" Margin="8,0,0,8">
<Label Text="Selection Mode:" VerticalTextAlignment="Center"/>
<Picker WidthRequest="180" HeightRequest="50" SelectedItem="{Binding SelectedSelectionMode, Mode=TwoWay}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Cell</x:String>
<x:String>Row</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</HorizontalStack>
<!-- DataGrid with multiple selection -->
<sfgrid:SfDataGrid Grid.Row="1"
x:Name="dataGrid"
ItemsSource="{Binding Orders}"
SelectionMode="Multiple"
AllowEditing="True" />
<sfPopupLayout x:Name="bulkEditPopup"
IsOpen="{Binding IsBulkPopupOpen}"
PopupViewHeight="200"
PopupViewWidth="300"
HeaderTitle="Bulk Edit"
ShowCloseButton="True">
<VerticalStackLayout Padding="12" Spacing="8">
<Label Text="{Binding TargetMappingName}" FontAttributes="Bold" />
<!-- Entry for text-based columns -->
<Entry Placeholder="Enter value"
IsVisible="{Binding IsStatusEditing, Converter={StaticResource BoolInverseConverter}}"
Text="{Binding BulkEditValue}" />
<!-- Picker for Status column -->
<Picker ItemsSource="{Binding StatusOptions}"
IsVisible="{Binding IsStatusEditing}"
SelectedItem="{Binding SelectedStatus}" />
<!-- Action buttons -->
<HorizontalStackLayout Spacing="8">
<Button Text="Apply" Command="{Binding ApplyBulkEditCommand}" />
<Button Text="Cancel" Command="{Binding CancelBulkEditCommand}" />
</HorizontalStackLayout>
</VerticalStackLayout>
</sfPopupLayout>- HeaderTitle: Displays "Bulk Edit".
- Dynamic UI: Switches between
EntryandPickerbased onIsStatusEditing. - Bindings: Uses
BulkEditValuefor text edits andSelectedStatusfor status updates. - Selection Modes: Cell Mode: Applies changes to one column across selected cells. Row Mode: Allows editing all fields for selected rows.
Thanks for reading! In this blog, we’ve seen Master Bulk Editing in .NET MAUI DataGrid. Check out our Release Notes and What’s New pages to see the other updates in this release and leave your feedback in the comments section below. For current Syncfusion customers, the newest version of Essential Studio is available from the license and downloads page. If you are not yet a customer, you can try our 30-day free trial to check out these new features. For questions, you can contact us through our support forums, feedback portal, or support portal. We are always happy to assist you!
If you are facing a path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.
For a step-by-step procedure, refer to the link.
