This is a migrated thread and some comments may be shown as answers.

Marking all rows as changed

1 Answer 480 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 1
Joseph asked on 16 Jun 2016, 01:46 PM

We have a C# MVC application that allows employees to enter hours spent per day on various activities for a given week (see the attached screenshot). However, one of the requirements of the application is that it update our Enterprise Resource Planning (ERP) system that we currently use. These updates must go into an intermediate table between this application and the ERP system. A stored procedure then picks up the data from this intermediate table and updates the ERP system appropriately. The trouble we are running into is getting the data accurately into the intermediate table. It needs the data put in as daily totals...

Date             Hours

6/1/2016       9

6/2/2016       8

6/3/2016       8.5

Can I mark every row in the grid as changed, whether it has changed or not, so that all the rows get sent over to my controller? We'd like to do this to make the processing of the data that's going into the intermediate table easier. Or, is it possible to send over the "Daily Totals" row in the footer? These are fields that are set on the DataSource using the built in Aggregates method. Our DataSource is configured as follows...

.DataSource(dataSource => dataSource
            .Ajax()
            .Aggregates(aggregates =>
            {
                aggregates.Add(t => t.Sunday).Sum();
                aggregates.Add(t => t.Monday).Sum();
                aggregates.Add(t => t.Tuesday).Sum();
                aggregates.Add(t => t.Wednesday).Sum();
                aggregates.Add(t => t.Thursday).Sum();
                aggregates.Add(t => t.Friday).Sum();
                aggregates.Add(t => t.Saturday).Sum();
                aggregates.Add(t => t.TotalHours).Sum();
            }
            )
            .Batch(true)
            .ServerOperation(false)
            .Events(events => events.Error("timesheetGrid_error_handler"))
            .Events(events => events.Change("timesheetGrid_change"))
            .Events(events => events.RequestEnd("timesheetGrid_requestEnd"))
            .Model(model => model.Id(t => t.rowId))            
            .Create(create => create.Action("Index_Create", "Home").Data("getCreateParams"))
            .Destroy(destroy => destroy.Action("Index_Delete", "Home").Data("getUpdateParams"))
            .Read(read => read.Action("Index_Read", "Home").Data("getReadParams"))
            .Update(update => update.Action("Index_Update", "Home").Data("getUpdateParams"))
        )

 

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 20 Jun 2016, 11:15 AM
Hello Joseph,

You can set the data row as dirty. See an example in this forum - http://www.telerik.com/forums/manually-set-grid-row-as-dirty

Regards,
Danail Vasilev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Joseph
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or