Datagrid Row Refesh Reload

Hi ,

I have a DataGrid,, the data is loaded in the pageload. on RowSelect method I check some values of the record and they can be corrected by the custom method .

How to reflect the changes made in the "code" to the row "The one-record" , so that we can see the changes ?
I pass the Row PK Id to the method an use that to get and update the database record. currently loaded in and selected in the DataGrid,

Have tried some suggestions like triggering a chage , but that works if currently loaded in the DataGrid.

1 Like

You can try calling the Reload method of the data grid instance e.g. grid0.Reload() (use Execute C# action to do that)

Will that retain current row selection and filter ? is there no change detection ?

If you don't want to call the Reload method simply "fix" your data before binding it to the data grid. To be honest "fixing" stuff on click sounds like odd user experience.

You should see it like an inline edit action.

By selecting a row , the user initiated an action, normally the user gets asked to confirm the situation or not . But there are some that the user Always has to confirm and can be default answered , without having the user do some action to confirm .

This can not be done in the read and load of the grid , it has to be user initiated , record has been clicked and seen by the user e.g.

Some bad word choices by me , it is not fixing any data, just want a change made by selecting / clicking a row known to the user visually,

Hope you understand .

Looking at the in-line generated pages :
in Rowselect : do checks and update data, load the record in an object by retrieving it by Id,
and executing : this.grid0.UpdateRow(entityRowData);

Could this work ?

I still don't understand what you are trying to achieve and I don't know if UpdateRow or grid0.Reload would work. You can always try though - should only take seconds.

@korchev :
What I want is that the DataGrid , reflects the changed row . and the change is done by a page method
Purpose is to proof that the user has clicked on the record and change the status etc.

Anyway , I have tried the UpdateRow method and this works .

Why I've asked you to confirm , maybe this is something we should not do ?


If this was something we didn't want our users to do it wouldn't have been in the public API and generated pages :slight_smile: Use whatever works for you - as long as it isn't private API invoked via reflection everything is fine.

1 Like