I have a GridTemplateColumn with a asp:ImageButton. I use it to go to another page and need to get with me the CommandArgument='<%# Container.DataItem("id") %>'
It works well, but have trouble with the CommandArgument when I try to insert a new record.
If i remove the CommandArgument='<%# Container.DataItem("id") %>' on insert it works fine. But if not, i have error:
System.MissingMemberException: No default member found for type 'GridInsertionObject'.
How do I get around the problem?
I have try with RadGrid1_ItemDataBound, but I get the error anyway.
It works well, but have trouble with the CommandArgument when I try to insert a new record.
If i remove the CommandArgument='<%# Container.DataItem("id") %>' on insert it works fine. But if not, i have error:
System.MissingMemberException: No default member found for type 'GridInsertionObject'.
<telerik:GridTemplateColumn HeaderButtonType="TextButton" HeaderStyle-Width="30px"> <ItemTemplate> <asp:ImageButton ID="imbEditDog" CommandArgument='<%# Container.DataItem("id") %>' ImageUrl="../../../picture/mini/edit.gif" ToolTip="Uppdatera" OnClick="EditHund" PostBackUrl="~/medlemsidor/minsida/hundar/editdog.aspx" BorderStyle="None" runat="server" /> </ItemTemplate></telerik:GridTemplateColumn>How do I get around the problem?
I have try with RadGrid1_ItemDataBound, but I get the error anyway.
If TypeOf e.Item Is GridDataInsertItem Or e.Item.IsInEditMode Then Dim editItem As GridEditableItem = DirectCast(e.Item, GridEditableItem) Dim imgButton As ImageButton = DirectCast(editItem.FindControl("imbEditDog"), ImageButton) imgButton.Enabled = FalseEnd If