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
515
show control in field.header
posted

Hi,

i have this code:

xaml: <igDP:XamDataGrid Name="XamDataGrid1"/>

 vb:

 

 

 

 

Public Class CViewmodel

 

 

 

Public ReadOnly Property FieldName As String

 

 

 

 

Get

 

 

 

 

 

Return "FieldValue"

 

 

 

End

Get

 

 

 

 

 

 

 

End Property

 

 

 

End Class

 

 

 

Private Sub MainWindow_Initialized() Handles Me.Initialized

 

 

 

Me.XamDataGrid1.DataSource = New CViewmodel() {New Viewmodel, New CViewmodel, New CViewmodel }

 

 

 

End Sub

 

 

 

 

Private Sub DataGrid_FieldLayoutInitialized() Handles _  XamDataGrid1.FieldLayoutInitialized

 

 

 

For Each aField As Field In e.FieldLayout.Fields

 

 

 

Dim aLabel As New TextBlock

aLabel.Text = aField.Name &

 

"*"

aField.Label = aLabel

 

 

Next

 

 

 

 

End Sub

 

 

It causes an exception. Why doesn't this work? How can in add a Control-Instance to the header?

Same problem is with the tabcontrol in dockingmanager. Guees same problem for all headeredcontentcontrols.

Thanks for your reply,

karle

Parents
No Data
Reply
  • 27093
    posted

    Hello Karle,

     

    I have been looking into your issue and am not quite sure what are you trying to achieve with this snippet. If you want to set your Field’s Label through code all you have to do is :

     

    aField.Label = aField.Name + " *"

     

    If you want to alter the visual tree of the Field header you can retemplate its LabelPresenter using the FieldSetting’s LabelPresenterStyle property. You can get the original template form the DefaultStyles folder provided with the product.

     

    Hope this helps. Please let me know if you require any further assistance on the matter.

     

    Sincerely,

    Petar Monov

    Developer Support Engineer

    Infragistics Bulgaria

    www.infragistics.com/support

     

Children
No Data