This is a migrated thread and some comments may be shown as answers.

No default member found for type 'GridInsertionObject'

1 Answer 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ronnie
Top achievements
Rank 1
Ronnie asked on 08 Sep 2008, 06:01 PM
I am using a user control as my edit form for my data grid.  Everything was going great until I had to populate my dropdown lists on the user control with the data when in edit mode on the datagrid.  Once I figured out how to populate the dropdowns in edit mode by using this code:

Protected

Sub grdProject_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grdProject.ItemDataBound
    If (TypeOf e.Item Is GridEditableItem AndAlso CType(e.Item, GridEditableItem).IsInEditMode) Then
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
        Dim UserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
        CType(UserControl.FindControl("dlstClassification"), DropDownList).SelectedValue = e.Item.DataItem("PROJECT_CLASSIFICATION")
        CType(UserControl.FindControl("dlstRating"), DropDownList).SelectedValue = e.Item.DataItem("PROJECT_RATING_ID")
        CType(UserControl.FindControl("dlstProjectStatus"), DropDownList).SelectedValue = e.Item.DataItem("PROJECT_STATUS")
        If Not e.Item.DataItem("PROJECT_ASSIGN_ID") Is System.DBNull.Value Then
            CType(UserControl.FindControl("dlstProjectAssignID"), DropDownList).SelectedValue = e.Item.DataItem("PROJECT_ASSIGN_ID")
        End If
        CType(UserControl.FindControl("dtReqCompDate"), Telerik.Web.UI.RadDatePicker).SelectedDate = e.Item.DataItem("PROJECT_REQ_COMP_DATE")
    End If
End Sub

My insert function stopped working correctly.  I started getting an error in the code above stating "No default member found for the type 'GridInsertionObject'.  Can anyone help me figure out what the issue is.

1 Answer, 1 is accepted

Sort by
0
Ronnie
Top achievements
Rank 1
answered on 08 Sep 2008, 08:10 PM
After reviewing some more form posts, I was able to add in the GridEditFormInsertItem into my ItemDataBound sub so that it would bring up my insert form without any issues.  To do that, I changed:

If (TypeOf e.Item Is GridEditableItem AndAlso CType(e.Item, GridEditableItem).IsInEditMode) Then

End Sub

to:

If

(TypeOf e.Item Is GridEditFormInsertItem) Then
ElseIf (TypeOf e.Item Is GridEditableItem AndAlso CType(e.Item, GridEditableItem).IsInEditMode) Then

End Sub

Tags
Grid
Asked by
Ronnie
Top achievements
Rank 1
Answers by
Ronnie
Top achievements
Rank 1
Share this question
or