anmcgrath / BlazorDatasheet

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

Cell/region names #84

Open TasosSarris opened 1 week ago

TasosSarris commented 1 week ago

Hi Can a name be defined for a cell or region?

anmcgrath commented 1 week ago

Not at the moment, named variables can only refer to values.

ADefWebserver commented 6 days ago

@TasosSarris - I am curious, how would you use this?

TasosSarris commented 5 days ago

I’m looking for a control that allows me to edit and view Microsoft Excel files. If I can name or tag specific cells, I can allow users to design forms under version control and, using the same control, create a viewer where other users can fill out these forms with values. The named cells will enable me to store these values in a table. In my previous Winforms application, I used the Grapecity Spread control for the same scope. Now, Blazor lacks something like this and I think that your control is very close to allowing scenarios like the above. Thank you for your quick response

anmcgrath commented 5 days ago

Hi @TasosSarris that sounds like a reasonable thing to do. Have you managed to use this control to load/save excel files? I'd be interested in seeing an example if so.

There is the ability to set metadata to each cell, not sure if that would help in your situation. E.g

sheet.Cells.SetMetadata(row, col, name, value);
var metaData = sheet.Cells.GetMetadata(row, col, value);

Cell metadata currently isn't handled correctly when inserting/removing rows/columns but I'm going to fix that soon.

TasosSarris commented 5 days ago

Thank you very much. I have not yet done the import/export. I plan to do it during the next weeks. I will send you an example as soon as I manage it.