I have implemented the "Edit on Double-click" functionaliy found in the online demo for my grid, but I need users to be able to edit in popup mode using a form template if they click a button column that I have added. That same popup needs to be used for new item inserts as well.
Here is the column I added:
and here is the code behind:
The problem is that the popup does not display when the user clicks the "Edit2" column or when they click "Add new record". Curiously though, the row is highlighted in yellow as if it was set to edit mode. What am I doing wrong here?
Here is the column I added:
<telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Edit2" Text="Edit2"></telerik:GridButtonColumn> |
and here is the code behind:
Protected Sub radgridItems_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) |
If e.CommandName = RadGrid.InitInsertCommandName Then 'add new item clicked |
If radgridItems.MasterTableView.EditMode <> GridEditMode.PopUp Then |
radgridItems.MasterTableView.EditMode = GridEditMode.PopUp |
radgridItems.Rebind() |
End If |
e.Canceled = True |
e.Item.OwnerTableView.InsertItem() |
ElseIf e.CommandName = "Edit2" Then 'custom button |
If radgridItems.MasterTableView.EditMode <> GridEditMode.PopUp Then |
radgridItems.MasterTableView.EditMode = GridEditMode.PopUp |
radgridItems.Rebind() |
End If |
radgridItems.MasterTableView.Items(e.CommandArgument()).Edit = True |
radgridItems.Rebind() |
ElseIf e.CommandName = "Edit" Then 'normal edit |
If radgridItems.MasterTableView.EditMode <> GridEditMode.InPlace Then |
radgridItems.MasterTableView.EditMode = GridEditMode.InPlace |
radgridItems.Rebind() |
End If |
radgridItems.MasterTableView.Items(e.Item.ItemIndex).Edit = True |
radgridItems.Rebind() |
End If |
End Sub |
The problem is that the popup does not display when the user clicks the "Edit2" column or when they click "Add new record". Curiously though, the row is highlighted in yellow as if it was set to edit mode. What am I doing wrong here?