Hi,
I have a grid that is storing key values using the DataKeyName property on the MasterTableView.
<MasterTableView DataKeyNames="col1, col2, record_timestamp">
Special attention needs to be paid to the record_timestamp value stored in the grid. This value is used for concurrency control and needs to be updated whenever the correponding record is updated.
Consider the following scenario.
(1) Grid loads for the first time. Every row in the grid has the values stored in the DataKeyNames property.
(2) The user updates a drop-down which results in a partial post back to the server and that particular record is updated in the database. This update results in a new value for the record_timestamp.
I need to find a way to update the grid to have this update value for that particular row!
The following code snippet would provide some insight as to how I am coding the method.
Thanks,
Manny
I have a grid that is storing key values using the DataKeyName property on the MasterTableView.
<MasterTableView DataKeyNames="col1, col2, record_timestamp">
Special attention needs to be paid to the record_timestamp value stored in the grid. This value is used for concurrency control and needs to be updated whenever the correponding record is updated.
Consider the following scenario.
(1) Grid loads for the first time. Every row in the grid has the values stored in the DataKeyNames property.
(2) The user updates a drop-down which results in a partial post back to the server and that particular record is updated in the database. This update results in a new value for the record_timestamp.
I need to find a way to update the grid to have this update value for that particular row!
The following code snippet would provide some insight as to how I am coding the method.
Protected Sub ddlCountries_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) |
Try |
Dim dropdown As DropDownList = DirectCast(sender, DropDownList) |
Dim tc As GridTableCell = DirectCast(dropdown.Parent, GridTableCell) |
Dim dataItem As GridDataItem = DirectCast(tc.Parent, GridDataItem) |
col1Value = dataItem.GetDataKeyValue("col1") |
col2Value = dataItem.GetDataKeyValue("col2") |
recordtimestampValue = dataItem.GetDataKeyValue("record_timestamp") |
' Update the database and get the new timestamp value |
' Update the grid item to have the new timestamp value stored in the data keys ????? |
Catch ex As Exception |
' handle error |
Finally |
End Try |
End Sub |
Thanks,
Manny