A
A
Artyom Pletnev2013-12-05 16:16:49
Microsoft Silverlight
Artyom Pletnev, 2013-12-05 16:16:49

How to find component in DataTeplate?

So. We have a table (telerik: RadGridView), columns are dynamically added to it:

IrregGridView.Columns.Add(new GridViewDataColumn()
{
  UniqueName = string.Format("Column{0}",x.DayNumber),
  Header = x.DayNumber.ToString(),
  HeaderTextAlignment = TextAlignment.Center,
  TextAlignment = TextAlignment.Center,
  Width = GridViewLength.Auto,
  MaxWidth = 90,
  IsFilterable = false,   
  CellTemplate = (System.Windows.DataTemplate) 
    XamlReader.Load(string.Format(@"<DataTemplate 
         xmlns='http://schemas.microsoft.com/client/2007'  
         xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
          <StackPanel Orientation=""Vertical"" Margin=""-2,0,-2,0"" MinWidth=""38"">
                     <TextBox  Text=""{{Binding Path=Results[{0}].ModelVLimit}}"" />
                     <TextBox Text=""{{Binding Path=Results[{0}].ModelVSum}}""/>
                      <TextBox Name=""tbVLimit{0}"" Text=""{{Binding Path=Results[{0}].VLimit, Mode=TwoWay}}"" />
                      <TextBox Text=""{{Binding Path=Results[{0}].VSum, Mode=TwoWay}}"" />
         </StackPanel>
         </DataTemplate>", x.DayNumber-1)) });
var column=IrregGridView.Columns[string.Format("Column{0}", x.DayNumber)];

Actually the question is: how to find the element tbVLimit{i}? , which is in the DataTemplate?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Teacher, 2013-12-06
@Aptem_Pletnev

Good afternoon. Have you looked at
this example ?

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question