HI,
how do i access the header of xampresenter (datacard option)?
my code looks like:
Private Sub myDataPresenter_RecordActivated(sender As Object, e As Infragistics.Windows.DataPresenter.Events.RecordActivatedEventArgs) Handles myDataPresenter.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)
'bring up the extra required fields Dim myProgrammeExerciseSpecs As New ProgrammeExerciseSpecs
myProgrammeExerciseSpecs.exerciseid =THIS IS WHERE I NEED TO GET THE HEADER TEXT myProgrammeExerciseSpecs.programmid = myprogrammeid myProgrammeExerciseSpecs.programmetitle = Me.cbotitle.Text.ToString() myProgrammeExerciseSpecs.programmedesc = Me.txtcontent.Text.ToString() myProgrammeExerciseSpecs.lbltitle.Content = myRecord.Cells(0).Value.ToString() myProgrammeExerciseSpecs.txtcontent.Text = myRecord.Cells(1).Value.ToString() myProgrammeExerciseSpecs.ShowDialog()
End If
End Sub
Hello,
Thank you for your post. I have been looking into it and I can suggest you use the following code to get the ActiveRecord’s Header Text:
e.Record.FieldLayout.PrimaryField.Label.ToString
Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Hi Stefan,
does not seem to do what i am after.
my xaml looks like below. the field i need to get to via vb is the HeaderPath:
<igDP:XamDataPresenter.View> <igDP:CardView> <igDP:CardView.ViewSettings> <igDP:CardViewSettings HeaderPath="ExerciseID" CollapseCardButtonVisibility="Hidden" ShouldAnimateCardPositioning="False" /> </igDP:CardView.ViewSettings> </igDP:CardView> </igDP:XamDataPresenter.View>
I have attached a VB version of the sample. Please let me know if this helps you or you need further assistance on this matter.
when i try and use the line below which you used in your example vb.net does not recognise it. if i do .name.tostring or .label.tostring it just returns the content of the label, and not the field value.
.....FieldLayout.PrimaryField.Name.value.tostring
I have created a sample project for you with the functionality you want. Basically I didn’t set the Header Path, but I set the IsPrimaryField Property of the Field I want to show as header to True. And then by getting the primary field I was able to get the header value. Please let me know if this helps you or you need further assistance on this matter.