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
450
How to get column header text?
posted

Hello,

I´m working with a xamgrid and I need to get the columns header text. Is that possible??

I´m working with a user control and I receive a object from another user control. I use me.Xamgrid.ItemsSource=object to visualize it.

The xamgrid columns are the object fields and i need to use this field names (the xamgrid columns header) but i can not  work with the object.

Now i´m doing this

Try

           Dim p() As PropertyInfo = xGrid.ActiveItem.GetType.GetProperties

           For Each n As PropertyInfo In p

                Dim valorPropiedad As Object =  xGrid.ActiveItem.GetType().GetProperty(n.Name).GetValue(dataGrid.ActiveItem, Nothing)

                Dim a As New FieldEditor(FieldEditor.TiposDatos.TBoolean, False, n.Name)

                 stkCustom.Children.Add(a)

            Next

 

This n.name is what i need to recovery but i don`t want to have to make click in a row to have an active item.

If i could get the columns header text i wouldn´t need an active item

Thanks, you are doing a great work.

Sorry for my English.

David A.

 

Parents
  • 4475
    posted

    Hello,

     

    I have been looking into you question and in order to get the headers text you can use:  

     

    Dim myText = XamGrid1.Columns(0).HeaderText

     

    Please let me know if I can assist you further with this issue.

     

     

    Sincerely,

    Ekaterina

    Developer Support Engineer

    Infragistics, Inc.

    www.infragistics.com/support

     

Reply Children