Refering to the example http://www.telerik.com/community/forums/aspnet-ajax/grid/two-different-insert-forms.aspx#720782 pls let me know this : pls
For the same solution, how do I attach Panel2, such that it acts as an update record form something like this :
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand |
If e.CommandName = "BatchModeInsert" Then |
e.Item.OwnerTableView.IsItemInserted = True |
insert1 = "BatchModeInsert" |
Me.RadGrid1.Rebind() |
End If |
If e.CommandName = "SingleModeInsert" Then |
e.Item.OwnerTableView.IsItemInserted = True |
insert2 = "SingleModeInsert" |
Me.RadGrid1.Rebind() |
End If |
If e.CommandName = "Update" Then |
e.Item.OwnerTableView.IsItemInserted = True |
insert3 = "Update" |
Me.RadGrid1.Rebind() |
End If |
End Sub |
And then in the ItemDatabound :
Private Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound |
If e.Item.OwnerTableView.IsItemInserted And TypeOf (e.Item) Is GridEditFormInsertItem Then |
Dim item As GridEditFormInsertItem = TryCast(e.Item, GridEditFormInsertItem) |
If insert1 = "BatchModeInsert" Then |
item.FindControl("Panel1").Visible = False |
End If |
If insert2 = "SingleModeInsert" Then |
item.FindControl("Panel2").Visible = False |
End If |
If insert3 = "Update" Then |
item.FindControl("Panel2").Visible = False |
End If |
End If |
End Sub |
I'm sure I need to add some flag that will bring up the update form for the row.
Note: I will have three buttons in the edit item template column with commandName
BatchModeInsert, SingleModeInsert and third one with commandname set to "Update" and will use the same panel "Panel2" for update. pls know that I am using automatic operations for update and manual for insert