Search code examples
wpfwpf-controlswpfdatagridwpf-4.0

How to bind an item name in the inner collection in wpf


I have structure like

CollectionA { ItemA { Name } }

I need to bind the collection's first item's Name property to a TextBox control.

I have this collection in my view model. How do i specify the collection's first element to a TextBox control in wpf ?


Solution

  • <TextBox Text="{Binding CollectionA[0].Name}"></TextBox>