BlazorDatasheet icon indicating copy to clipboard operation
BlazorDatasheet copied to clipboard

It would be nice to add a context menu

Open bbd9987 opened this issue 2 years ago • 1 comments
trafficstars

It would be nice to add a context menu,copy, paste, cut ...

bbd9987 avatar Nov 03 '23 05:11 bbd9987

I am very much looking forward to this feature.

J7503303 avatar Mar 27 '24 02:03 J7503303

I've added a basic context menu in the main branch. I'd like to make it more customizable, so interested in feedback on the best way to do this.

anmcgrath avatar May 27 '24 10:05 anmcgrath

I've added a basic context menu in the main branch. I'd like to make it more customizable, so interested in feedback on the best way to do this.

@anmcgrath - Right now SheetMenuTarget is hard coded into DataSheet.razor? So it loads SelectionMenu.razor? If we could set this we could create our own menus? I want to show Columns but I don't want to show the add new columns and delete columns options and I can't figure out how to do that.

ADefWebserver avatar Jun 14 '24 01:06 ADefWebserver

@ADefWebserver I've been thinking about how to do this and the method I tried (replacing the menu Id and thus menu shown in a beforeMenuShownEvent args) is giving me some issues.

I think that ideally you should be able to use a custom menu for any of the sheet menus.

For now I've added some parameters to Datasheet.razor to control the default selection context menu:

    [Parameter] public bool CanUserRemoveRows { get; set; } = true;
    [Parameter] public bool CanUserRemoveCols { get; set; } = true;
    [Parameter] public bool CanUserInsertRows { get; set; } = true;
    [Parameter] public bool CanUserInsertCols { get; set; } = true;
    [Parameter] public bool CanUserSort { get; set; } = true;

anmcgrath avatar Jun 15 '24 11:06 anmcgrath

@anmcgrath - This-is-Perfect! Thank you very much! I hope to finish this database example in the next two weeks. I plan to remove all external dependencies and submit this as a possible PR
image

ADefWebserver avatar Jun 15 '24 13:06 ADefWebserver

@anmcgrath - I see that you now have a "merge" option. Can you also add a property to optionally disable this?
image

ADefWebserver avatar Jun 18 '24 16:06 ADefWebserver

@anmcgrath - I see that you now have a "merge" option. Can you also add a property to optionally disable this? image

Done

anmcgrath avatar Jun 19 '24 09:06 anmcgrath

@anmcgrath - Perfect! Thanks! image

ADefWebserver avatar Jun 19 '24 13:06 ADefWebserver