I have Datagrid which is bound to my Database
<WpfToolkit:DataGrid Name="DataGrid1" Grid.Row="1"
ItemsSource="{Binding Path=MainSearchBinding}" />
And I have row details which is bound to the Intro column of my table in database
<WpfToolkit:DataGrid.RowDetailsTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="5">
<StackPanel Orientation="Vertical" Margin="5" >
<TextBlock Foreground="CadetBlue" FontSize="13"
Width="Auto" TextWrapping="Wrap"
Text="{Binding Path=Intro}"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</WpfToolkit:DataGrid.RowDetailsTemplate>
What I want is not to use Intro column in my table. I want to use string value from my code instead of column Intro. How can I bind string value to my row details? Thanks in advance.
I modified my xaml code a little bit add Name to Text Block.
And the in code behind I add this code below to OnMouseClick. retString is my string variable. It is showing my string variable in each clicked row details.
Do not forget to add FindVisualChild in your code. Here is the code.
I do not know why nobody answered to my question. Maybe it is not popular.