Mobile gallery
I'm using a .NetMaui blazor project where I need to show the mobile phone gallery content in a listview or in a datagrid to select some images and send them to a ftp server
How can I show, first of all, the gallery content in a blazor hybrid project ?
The idea is to show the list of images inside a datagrid where I can add a checkbox column to select them
Thanks
Best Regards
Hi Walter,
To better assist you with your query, could you kindly provide us with more details regarding your requirements? Specifically, please provide details on how you would like to display the images, whether in a datagrid or listview format. Any additional information you can provide would be greatly appreciated, as it will allow us to offer you a more accurate and helpful solution. Additionally, if possible, please provide a simple sample or any other relevant details that may aid us in better understanding your request.
Regards,
Nirmalkumar
Originally I supposed to use a sort of function able to show in a datagrid the pictures available in the Android's gallery adding a checkbox column to select them but then I found this function
await MediaPicker.PickPhotoAsync();
and I used it successfully to show in the mobile phone its gallery and select a picture.
The problem is that apparently I can select only one picture and this is not good for me because I need to let the customer to select more than one picture, then get the images content and then send this content to a ftp server
How can I achieve this job ?
Hi Walter,
We suspect that you are expecting to select multiple images at your end. If so we suggest you to set selection type as multiple on DataGrid. Also here we have rendered checkbox column by setting column type as checkbox. Kindly check the below attached documentation and code snippet for your reference.
Reference: https://blazor.syncfusion.com/documentation/datagrid/selection#checkbox-selection
|
<SfGrid DataSource="@Orders" AllowSelection="true" AllowPaging="true"> <GridSelectionSettings Type="SelectionType.Multiple"></GridSelectionSettings> <GridColumns> <GridColumn Type="ColumnType.CheckBox" Width="50"></GridColumn> <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn> <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn> <GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn> <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn> </GridColumns> </SfGrid> |
If you still face any issue or if we misunderstood your query kindly share the below requested details.
- Share us the entire Grid code snippet.
- Share us the video demonstration of the reported issue.
- If possible share us an simple issue reproduceable sample.
The above requested details will be very helpful for us to validate the reported issue at our end.
Regards,
Monisha
Hello
the problem is not in SfGrid component and I don't have a code to share you because I need to know the best practise or a solution to write the code.
My goal is to show to the customer in Android's mobile phone a list of the pictures available in his mobile phone gallery and give him the option to select more than one row.
For this reason I guessed the right solution was having a function to load the pictures in a Sfgrid and adding a checkbox column to select more than one row but I don't know if this function exists
Then I found probably the right way using this function:
await MediaPicker.PickPhotoAsync();
where I can open to the customer the Android's gallery and let him select the pcitures, but unfortunately using this function he can select only one picture.
Is there any other way to do that ?
I'm using Syncfusion Maui Blazor Hybrid project
Thanks
Hi Walter,
Yes, it seems PickPhotoAsync supports selecting only one image at a time, as you've mentioned. A similar issue has been logged on the GitHub repository:
GitHub issue: https://github.com/dotnet/maui/issues/6903
To assist you better, could you please provide an image of your gallery along with your expectations? Clearly showing us the image of your gallery and what you expect would help us understand your requirements more accurately. Once we have this information, we can explore alternatives and share them with you.
Please let us know if you have any concerns.
Regards,
Monisha
- 5 Replies
- 3 Participants
-
WM Walter Martin
- Feb 5, 2024 03:12 PM UTC
- Feb 12, 2024 07:12 AM UTC