Silverlight / WPF - how to access DataGridTemplateColumn textbox value in CS page in wpf

Asked By sunil pandey on 10-May-12 02:59 AM

hello frnds

DataGridTemplateColumn Header="Data" Width="100">
   
<DataGridTemplateColumn.CellTemplate>
         
<DataTemplate>
             
<StackPanel Orientation="Horizontal">
                 
<TextBox Name="Description" text="" ></Label>
               

             
</StackPanel>
         
</DataTemplate>
   
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>


i want to access text box value in CS page in a button click. how to get this one.
Please reply asap
Somesh Yadav replied to sunil pandey on 10-May-12 05:44 AM
You can use datagrid template as:
<DataGridTemplateColumn Header="Command">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <Button Name="cmdCommand" Click="{Binding Command}"
                    Content="Command"/>
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn