Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #103695
    accsys
    Participant

    Hi,

    My grid currently tracks changes via the OnEndEdit event. This works really well and allows me to update my SQL database with the new value entered. However, this event doesn’t fire if someone copy/pastes a value. Looking at all the events I’m hoping that OnCellUpdate will but am struggling to get the event to work in a Blazor Server app.

    The OnEndEdit event passes an Event type which gets converted to an GridEndEditEventDetail type where I can easily access the row, column value etc…
    async void EndEditHandler(Event args)
    {
    GridEndEditEventDetail detail = args[“Detail”] as GridEndEditEventDetail;
    long rowId = detail.Row;
    string colId = detail.Col
    }

    The OnCellUpdate event passes an Object type and looking at the types available I assumed this would be a GridRowCell object as this seems to have the Value and OldValue properties that the OnCellUpdate supposedly passes. I’ve tried the following…

    async void CellUpdateHandler(Object args)
    {
    GridRowCell detail = args as GridRowCell;
    string oldValue = detail.OldValue.ToString();
    string newValue = detail.Value.ToString();
    }

    But detail always ends up as a null reference.

    I’m fairly new to C# / Blazor Server and very new to your components so I’m sure I’m missing something obvious but I just can’t work out what it is! The Blazor examples are very useful but I feel there needs to be much more of them. For example the OnCellUpdate just has one section in the API documentation but doesn’t really explain how you can use it.

    Any help would be appreciated.

    Thanks,

    Tobie

    #103704

    Hi,

    OnCellUpdate accepts object you cannot cast it to any type.
    I suggest you use it as an object.

    If you have any further questions, please do not hesitate to contact us!

     

    Best Regards,
    Svetoslav Borislavov

    Smart UI Team
    https://www.htmlelements.com/

    #103706
    accsys
    Participant

    Ok thanks.

    Would you be able to post an example of how I can access the relevant properties such as OldValue, Value, Row, Column etc.

    Many thanks,

    Tobie

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.