Hi,
I need help on using the Edit and custom form within the grid. this is the first time i am trying to do this, so any one can help me will be great.
I am binding the grid to datasource progmaticaly, and i set the Editmode to EditForms, and i have customized the form.
My grid have only 3 clume: Year, Start Date and End date, and i want to enable the user to update this with in the grid, also to insert new records for each year.
so this what i am trying, and i am sure it's wrong, i am trying to read the fields first to my textbox with in the grid template for the update and then when the user click update it will update the record. so far i can not even read the data into by textboxes. Please help.
Protected Sub grid1_EditCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grid1.EditCommand
ReadGrid()
Dim sqlstr As String
Dim dr As Data.SqlClient.SqlDataReader
sqlstr =
"select * from acc_accountyear where year='" & CType(e.Item, GridDataItem)("id").Text & "'"
dr = ACCiMS_DB.Read_DR(sqlstr)
While dr.Read
CType(e.Item.FindControl("txt_year"), TextBox).Text = dr("year")
CType(e.Item.FindControl("txt_sd"), TextBox).Text = dr("startdate")
CType(e.Item.FindControl("txt_ed"), TextBox).Text = dr("enddate")
End While
dr.Close()
End Sub