Thanks for your commentes. Can you post a sample of how to make the EditChildRecord?
Regards
Juan Carlos, here ae the two mehods need for this functionality, I simply copied them from the source to the form where the ListView is being used and modified as needed.
''' <summary>''' 09/08/2008 Edhy Rijo''' Edits the currently selected child record''' This method should be use temporarily until the internal one in the listview''' is made available by SF Team''' </summary>''' <remarks></remarks>Private Sub EditChildRecord() Dim bo As BusinessLayer = Me.lstItems.BusinessObject '-- If no business object is attached then there is nothing to do If bo Is Nothing Then Exit Sub'-- See if a snapshot should be takenIf Me.lstItems.AutoSnapshotBusinessObject Then bo.SaveCurrentDataTableToSnapshot(Me.lstItems.AutoSnapshotKey)'-- Ensure the the correct record is selected in case it had been moved by the developer bo.NavigateToPrimaryKey(Me.lstItems.SelectedItems(0).Tag) '-- Place the record in edit mode bo.Edit() '-- See if there is a child dialog If lstItems.ChildForm IsNot Nothing Then '-- Raise the before child form executed event ' OnBeforeChildFormExecuted(New ListViewBeforeChildExecuteEventArgs(ListViewChildFormAction.Edit)) '-- Call the child form and create the args Dim args As New MicroFour.StrataFrame.UI.Windows.Forms.ListViewChildFormResultsEventArgs(MicroFour.StrataFrame.UI.ListViewChildFormAction.Edit, Me.lstItems.ChildForm.ShowDialog()) ''-- Raise the event Me.lstItems_ChildFormResults(Me.lstItems, args) '-- See if the list should be requeried If args.Requery Then '-- Save off the primary key value Dim reselect As Boolean = True Dim pk As Object = Nothing Try pk = bo.CurrentRow(bo.PrimaryKeyField) Catch ex As Exception reselect = False End Try '-- Requery the list Me.lstItems.Requery() '-- Attempt to select the item If reselect Then SelectIndexByPrimaryKey(pk) End If End IfEnd Sub''' <summary>''' 09/08/2008 Edhy Rijo''' Attempts to select the row index associated with the specified primary key''' This method is used by EditChildRecord''' This method should be use temporarily until the internal one in the listview''' is made available by SF Team''' </summary>''' <param name="primaryKey"></param>''' <remarks></remarks>Private Sub SelectIndexByPrimaryKey(ByVal primaryKey As Object) For Each i As ListViewItem In Me.lstItems.Items If i.Tag.Equals(primaryKey) Then '-- Select the item i.Selected = True '-- Ensure this item is visible Me.lstItems.EnsureVisible(Me.lstItems.Items.IndexOf(i)) '-- Nothing left to do Exit For End If NextEnd Sub
'-- See if a snapshot should be taken
bo.NavigateToPrimaryKey(
bo.Edit()
pk = bo.CurrentRow(bo.PrimaryKeyField)
reselect =
i.Selected =
The routine works great thanks. Just a simple question:
How do I exclude some fields from being copied? I did in a Maintenance form and works:
... some other fields here
Me
But using the same logic in the ListView, the record is not copied.
Do you have some ideas?
Regards Everything is possible, just keep trying...