I have a WebDataGrid bound to a DataSource. The columns are not being autogenerated. I've made edits to the items in the WebDataGrid. However, I'm not seeing the changes reflected in the GridRecordItem when I loop thru the rows. I was expecting to see the changed values in objGridRecordItem.Text, but I'm still seeing the original values prior to my edits.What am I doing wrong?
Ed T
Private Sub WebDataGridLoop() Dim strColumnName As String Dim objGridRecordItem As GridRecordItem Dim objBoundDataField As BoundDataField Dim i As Integer
For Each row As GridRecord In Me.wdgInvoiceServiceFeeDefault.Rows
Dim objInvoiceServiceFeeDefault As New InvoiceServiceFeeDefault
i = row.Items.Count
For i = 0 To (i - 1)
objGridRecordItem = row.Items(i) objBoundDataField = row.Items(i).Column strColumnName = objBoundDataField.DataFieldName
Select Case strColumnName Case AutoSignupDefaultInvoiceServiceFeeDCSchema.InvoiceServiceTypeID objInvoiceServiceFeeDefault.InvoiceServiceTypeID = objGridRecordItem.Text Case AutoSignupDefaultInvoiceServiceFeeDCSchema.ServiceUnitID objInvoiceServiceFeeDefault.ServiceUnitID = objGridRecordItem.Text Case AutoSignupDefaultInvoiceServiceFeeDCSchema.ServiceFreeQty objInvoiceServiceFeeDefault.ServiceFreeQty = objGridRecordItem.Text Case AutoSignupDefaultInvoiceServiceFeeDCSchema.ServiceFee objInvoiceServiceFeeDefault.ServiceFee = objGridRecordItem.Text End Select
Next
Me.InvoiceServiceFeeDefaultInsert(objInvoiceServiceFeeDefault)
End Sub
Ed,
Let me know if I can help.
I guess that would shut off sorting and filtering too so you'd have to make that call.
Ed
Hi,
You can probably turn off Ajax in the grid and then leave activation on and the system wouldn't do any updates until you hit the button.
Its working now. I moved the sub to the PreRender event as you suggested and also set the EnableDataViewState property to True.
Although I'm not using Radoslav's work around for Batch Updating, I noticed a problem with turning off Activation Behavior...I could no longer tab from cell to cell. Is it possible to selectively turn off Activation Behavior properties so that both Batch Updating and cell tabbing works?
Thanks for all your help.
Are you rebinding the data on page load even on postbacks? You would be overwriting the changes.