Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
995
Double click datapresenter
posted

Hi,

I have the below code which triggers when a record in the datapresenter is activated.  Basically all it does is grab the selected data and use it in some other routines.  I would like to move code out of the record activated event and into a double click event.

Private Sub XamDataPresenter1_RecordActivated(ByVal sender As Object, ByVal e As Infragistics.Windows.DataPresenter.Events.RecordActivatedEventArgs) Handles XamDataPresenter1.RecordActivated

If TypeOf e.Record Is FilterRecord Then
Exit Sub
End If

' Check to make sure the selected Record is a DataRecord
If TypeOf e.Record Is DataRecord Then


' Cast the record passed in as a DataRecord
Dim myRecord As DataRecord = CType(e.Record, DataRecord)

If IsNothing(myRecord.Cells(0).Value) = False Then
lblclient.Content = myRecord.Cells(0).Value.ToString()

displayclientprograms()

'get assessment history
getclientassessmenthistory()

End If

End If
End Sub

How do i do this?

Parents
No Data
Reply
  • 890
    posted

    Hi Pfechner,

     

    If the idea is to double click a record and then execute some logic with the data recod you could try something like this:

    private void xdp_MouseDoubleClick_1(object sender, MouseButtonEventArgs e)

            {

                var valueEditor = Infragistics.Windows.Utilities.GetAncestorFromType((DependencyObject)e.OriginalSource, typeof(ValueEditor), true);

     

                if (valueEditor != null)

                {

                    if (((ValueEditor)valueEditor).DataContext is DataRecord)

                    {

                        DataRecord dr = ((ValueEditor)valueEditor).DataContext as DataRecord;

                    }

                }

            }

    Please let me know if this works for you or if I misunderstood you.

    Thanks,

    Slavi

Children
No Data