I set the data source of my radGrid to a dataset (which I saved in the session). I turned on AllowAutomaticUpdates and EnableViewState, implemented NeedDataSource, installed DatakeyNames, etc. (See code below)
However, when I click the โChangeโ button and make changes and click the โRefreshโ link, the record does not update and does not exit the editing mode ... it just remains in the editing mode and no error occurs.
So the question is ... does anyone know if radGrid with EnableViewstate can even support AutomaticUpdates, so changes to the grid will automatically be inserted into the dataset to which it is bound?
You might think that you can read the documentation, but I could not find the final answer.
thanks
<telerik:Radgrid id="grid" runat="server" AllowPaging="True" AllowSorting="True" AllowAutomaticUpdates="true"
AutoGenerateEditColumn="True" GridLines="None" >
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim data As New DataGateway
Dim ds As DataSet = data.GetEmployeesByProgram(Year:=2009, ProgramName:="Long Term Incentive Stock Program")
Dim dt As DataTable = ds.Tables(0)
ds.Tables(0).PrimaryKey = New DataColumn() {dt.Columns("EmployeeNum"), dt.Columns("ProgramName"), dt.Columns("Year")}
Session("datasource") = ds
With Me.grid
.AllowAutomaticUpdates = True
.AutoGenerateColumns = True
.AllowSorting = True
.AutoGenerateEditColumn = True
.EnableViewState = True 'IS REQUIRED!!!
Me.grid.MasterTableView.AllowAutomaticUpdates = True
Me.grid.MasterTableView.EditMode = GridEditMode.InPlace
End With
End If
End Sub
Private Sub grid_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles grid.NeedDataSource
Debug.WriteLine("NeedDataSource: " & e.RebindReason.ToString)
Dim ds As DataSet = CType(Session("datasource"), DataSet)
Me.grid.MasterTableView.DataKeyNames = New String() {"EmployeeNum", "ProgramName", "Year"}
Me.grid.DataSource = ds
End Sub
tbone source
share