Second-level property binding in wpf Datagrid DataGridTemplateColumn TextBlock
<p>I have got a dataGrid with columns created with the help of DataGridTemplateColumn technology. 
Here is the column I am interested in in my DataGrid (Name = "Dgrv)</p>

<hr>

<h2>XAML</h2>

<hr>

<pre><code>&lt;DataGridTemplateColumn Width="40"&gt;
                    &lt;!--="Name"--&gt;
                    &lt;DataGridTemplateColumn.CellTemplate&gt;
                        &lt;DataTemplate&gt;
                            &lt;StackPanel&gt;
                                &lt;TextBlock Text="{Binding TextCell.txtbx}" 
                                           TextAlignment="Center" Margin="0, 8, 0, 0"/&gt;
                                &lt;Canvas Background="Black" Height="1" Margin="5,5,5,0"/&gt;
                                &lt;TextBlock Text="{Binding OperatorCode}" TextAlignment="Center" Margin="0, 5, 0, 0"/&gt;
                            &lt;/StackPanel&gt;
                        &lt;/DataTemplate&gt;
                    &lt;/DataGridTemplateColumn.CellTemplate&gt;
                &lt;/DataGridTemplateColumn&gt;
</code></pre>

<p>In my backend I have got the next code: </p>

<hr>

<h2>XAML.cs</h2>

<hr>

<pre><code>var list = new List&lt;Contract&gt;();
        list.Add(new Contract
        {
            ID = 1,
            CompanyName = "Технабсервис",
            HeadName = "Петров\nАлександр\nНиколаевич",
            CountryCode = "+7",
            OperatorCode = "495",
            Date = Convert.ToDateTime("21.02.2012").ToString("dd.MM"), //GetDateTimeFormats('mm, dd'), 
            Time = "16:39",
            Telephones = "(495)123-4567 (общий)",
            Comment = ""
        });
Dgrv.ItemsSource = list;
</code></pre>

<hr>

<h2>  Here is my class Contract.cs</h2>

<hr>

<pre><code>public class Contract
    {
        public int ID { get; set; }
        public string CompanyName { get; set; }
        public string HeadName { get; set; }
        public string CountryCode { get; set; }
        public string OperatorCode { get; set; }
        public String Date { get; set; }
        public String Time { get; set; }
        public String Telephones { get; set; }
        public String Comment { get; set; }
        public TextCell smth { get; set; }

        /*public Dictionary&lt;string, int&gt; PriceFields { get; private set; }
        public Dictionary&lt;string, string&gt; RateFields { get; private set; }
        public Dictionary&lt;string, string&gt; TypeFields { get; private set; }
        public Dictionary&lt;string, string&gt; TicketFields { get; private set; }*/

        public Contract()
        {
            smth = new TextCell();
        }
    }
</code></pre>

<p>And, finally my class TextCell (as you could see, I want to bind TextBlock`s text to the field of this class with name "txtbx"</p>

<hr>

<h2>TextCell.cs</h2>

<hr>

<pre><code>public class TextCell
    {
        public String txtbx { get; set; }
        public TextCell()
        {
            txtbx = "sdbjshfk";
        }

        public override string ToString()
        {
            return txtbx;
        }
    }
</code></pre>

<p>So, the question is about this part of code</p>

<pre><code>&lt;TextBlock Text="{Binding TextCell.txtbx}" 
                                               TextAlignment="Center" Margin="0, 8, 0, 0"/&gt;
</code></pre>

<p>It is not working at all. I understand, that I can bind TextBlock`s text to the TextCell field itself. The ToString() method will be called in such case, but that is not enough for me. Mainly, because the situation described in this post is just an example and I have got far more situations where I will need such type of binding. </p>

<p>So, the TextCell class has been created just as an example in order to understand the required technology.</p>