Hi,
I am trying to set a default value in a textbox when a new row is inserted in the grid.
I tried the code below, but that never passes the condition of the if-statement.. I am using the standard in-line editing.
I am trying to set a default value in a textbox when a new row is inserted in the grid.
I tried the code below, but that never passes the condition of the if-statement.. I am using the standard in-line editing.
Protected Sub gridActivities_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles gridActivities.ItemDataBound
If (TypeOf e.Item Is GridEditFormInsertItem) AndAlso (gridActivities.MasterTableView.IsItemInserted) Then
Dim insertItem As GridEditFormInsertItem = CType(e.Item, GridEditFormInsertItem)
'getting the Textbox in the insert form using it's UniqueName
Dim txbCategoryID As TextBox = CType(insertItem("intCategory").Controls(0), TextBox)
txbCategoryID.Text = Request.QueryString("Category")
End If
End Sub
What am I doing wrong?