anmcgrath / BlazorDatasheet

Simple excel-like datasheet Blazor component
MIT License
131 stars 31 forks source link

It would be nice to add a context menu #53

Closed bbd9987 closed 1 week ago

bbd9987 commented 8 months ago

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

ganjiayi commented 3 months ago

I am very much looking forward to this feature.

anmcgrath commented 1 month ago

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.

ADefWebserver commented 2 weeks ago

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.

anmcgrath commented 2 weeks ago

@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;
ADefWebserver commented 2 weeks ago

@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 commented 2 weeks ago

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

anmcgrath commented 2 weeks ago

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

Done

ADefWebserver commented 1 week ago

@anmcgrath - Perfect! Thanks! image