Hello,
How could I change xamDataGrid label height in procedure code?
I tried the below code, but it didn't work.
Private Sub GridInfragistics_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded 'ColumnHeaderHeight is a dependency property of the GridInfragistics user control and it is greater than 0 If ColumnHeaderHeight > 0 Then Dim labelPresenter As LabelPresenter = TryCast(Infragistics.Windows.Utilities.GetDescendantFromType(grdTable, GetType(LabelPresenter), False), LabelPresenter)
If labelPresenter IsNot Nothing Then Dim labelParent As DependencyObject = labelPresenter.Parent
Dim count As Integer = VisualTreeHelper.GetChildrenCount(labelParent)
For i As Integer = 0 To count - 1 Dim child As LabelPresenter = TryCast(VisualTreeHelper.GetChild(labelParent, i), LabelPresenter) If child IsNot Nothing Then child.Height = ColumnHeaderHeight End If Next End If End If End Sub
Is there any easy way to change labe height?
Thanks.
I worked. Thank you.
Yes, you can use the LabelHeight property in the FieldSettings:
xamDataGrid1.FieldSettings.LabelHeight = 100
Hope this helps.